launch icon indicating copy to clipboard operation
launch copied to clipboard

Provide roslaunch xml schema definition downloadable

Open adrienbarral opened this issue 6 years ago • 6 comments

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).

adrienbarral avatar Mar 20 '20 09:03 adrienbarral

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

joshwapohlmann avatar Jun 10 '20 14:06 joshwapohlmann

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 launch functionality, and one in top of that with the extra launch_ros features.
  • 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_xml finds 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).

ivanpauno avatar Jun 26 '20 13:06 ivanpauno

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.

adrienbarral avatar Jun 26 '20 14:06 adrienbarral

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.

ivanpauno avatar Jun 26 '20 15:06 ivanpauno

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

Ryanf55 avatar Jan 26 '24 01:01 Ryanf55