ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

URDF model using the a variable parameter

asked 2020-09-17 03:14:22 -0500

vk gravatar image

I have a model in urdf file. I would like to change the dimension of the model depending on a parameter "x". This parameter will be calculated once in a program. I would like to know how to achieve the setting up the parameter in urdf.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-09-17 04:11:22 -0500

Weasfas gravatar image

Hi @vk I recommend you to check some of the URDF and Xacro tutorials in the wiki.

If you want to add parameters to an URDF description you will need to use Xacro instead of URDF, since URDF does not implement a functionality for that pourpose. Once you have translated your URDF model to Xacro, you will be able to add properly the parameters you want with something like:

<xacro:arg name="x_arg" default="10"/>
<xacro:property name="x_property" value="$(arg x_arg)" />

That will store in x_property the argument X you passed to the Xacro file. Note that in order to use the argument in Xacro you will need to define it as a property and access it with $() keys.

Hope that helps yout.


edit flag offensive delete link more

Question Tools



Asked: 2020-09-17 03:14:22 -0500

Seen: 1,962 times

Last updated: Sep 17 '20