0
$\begingroup$

Rosanswers logo

Hi,

I'm looking to control some parameters of my model through the ros launch file. I know that this used to be handle with xacro in urdf file and ruby allow some features in SDF but I not sure how to processed so that I can pass on the arguments from the launch file.

Also, would it be better to rather use urdf for my model?

Thanks

Alex


Originally posted by AlexandreB on ROS Answers with karma: 43 on 2015-12-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The URDF vs SDF discussion is something delicate. It is true that SDF is more flexible in terms of simulation as it solves some URDF problems, but URDF has much better integration with ROS and you can easily leverage ROS tools such as TF, etc. It really depends whether the URDF limitations affect your application.

Anyway, it is possible to give parameters to xacro from launchfiles as detailed in this answer. In short, you can write in your launchfile

<param name="robot_description" command="$(find xacro)/xacro.py '$(find my_robot_description)/urdf/my_robot.urdf.xacro' prefix:=$(arg ns)" />

and then use $(arg prefix) in your xacro file.

Note: As far as I know, there is a limitation with this solution that xacro default values cannot be given, which means that you always have to include your values when calling xacro.py


Originally posted by Javier V. Gómez with karma: 1305 on 2016-01-18

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by AlexandreB on 2016-01-18:
Thanks for the clarification! I heard gazebo is heading towards SDF is that correct?

Comment by Javier V. Gómez on 2016-01-19:
Kind of correct. SDF aims to be an unified format for simulators. Gazebo is not bound to ROS; while URDF is a ROS thing. Therefore, it would not make sense to use URDF if you are using Gazebo but not ROS.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.