Provide roslaunch xml schema definition downloadable
It would be nice to have the roslaunch xml definition (https://design.ros2.org/articles/roslaunch_xml.html#let-tag) downloadable somewhere.
I guess that the good place should be here : http://download.ros.org/schema/ (close to the package format definition).
Could someone comment what's the plan with this? We decided to use .xml launchfiles since xml has this nice validation feature. Personally I always start a launch file like this and make sure it is validated as I go
<?xml version="1.0" encoding="UTF-8"?>
<launch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ros2launchfile.xsd" version="0.1.0">
</launch>
I'd prefer to refer to an online resource as @adrienbarral suggested rather than downloading it from https://design.ros2.org/articles/roslaunch_xml.html
Hi @adrienbarral @joshwapohlmann !
I think that adding schema validation is a good idea. We could provide an online resource, or maybe we could also provide the file with the installation of launch/launch_ros.
To make things simple, we could move the schema definition to launch_ros repository, and it will be available in a link similar to:
https://raw.githubusercontent.com/ros2/design/gh-pages/articles/specs/launch.0.1.1.xsd
Does that sound like a good idea?
Some extra notes:
- It should be added to launch_ros repo and not here, as launch_ros adds extra functionality. Ideally, we should have two schemas: one with bare
launchfunctionality, and one in top of that with the extralaunch_rosfeatures. - We should use the schema in some of the tests here and in launch_ros repo, to make sure we keep it up to date.
- The main reason to move the schema here from ros2/design is that we could easily update implementation and schema in one PR.
- If
launch_xmlfinds a launchfile that provides a schema link, we should make sure it makes the schema validation. - We could potentially have schema validation for launch_yaml files (e.g. using pyrx).
Yes it sound like a very good idea.
I am ros user, so I don't really care of a "launch only" schema definition, but that can make sense to have two schemas.
Yes it sound like a very good idea.
I am ros user, so I don't really care of a "launch only" schema definition, but that can make sense to have two schemas.
Yes, starting only with launch_ros sounds good.
There's no plan to address this issue in a near future, so contributions to address some of the bullets above are more than welcomed.
ament_lint_xmllint could then automatically validate launch files in your repo are compliant to the schema. We already get warnings when migrating from ROS 1 to ROS 2 on your package.xml if you use removed attributes.
https://stackoverflow.com/questions/42809088/how-to-validate-a-xml-file-with-xsd-through-xmllint