Ask Your Question
0

Help with xacro default values

asked 2018-02-08 03:55:41 -0500

F.Brosseau gravatar image

Hello everybody,

I have seen an interesting tool that I wanted to use : default values for parameters in xacro

http://wiki.ros.org/xacro#Default_par...

But when I am trying to use it, the model can't be loaded. There is some test that I made :

<xacro:macro name="lidar" params="lidarName x y z roll pitch yaw min_angle:=-2.36 max_angle:=2.36">

invalid parameter min_angle

<xacro:macro name="lidar" params="lidarName x y z roll pitch yaw min_angle:='-2.36' max_angle:='2.36'">

invalid parameter min_angle

<xacro:macro name="lidar" params="lidarName:=lms x:=0.0 y:=0.0 z:=0.0 roll:=0.0 pitch:=0.0 yaw:=0.0 min_angle:=-2.36 max_angle:=2.36">

Invalid parameter "roll"

This model works perfectly when I don't try to use default values.

I am using ROS indigo 1.11.20.

There is my questions :

Do i need to set a default value for each parameter ?

Is there an obvious mistake that I am missing in the declaration of my macro ?

Am I running a ROS version that supports this xacro default values ?

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-02-08 04:24:47 -0500

gvdhoorn gravatar image

updated 2018-02-08 04:27:53 -0500

I am using ROS indigo 1.11.20.

[..]

Am I running a ROS version that supports this xacro default values ?

you are, but you're probably not 'activating' them.

In order to use Jade+ xacro features under Indigo, you need to invoke the xacro script like so:

xacro --inorder /path/to/your/top-level/file.xacro

Note: I haven't checked your syntax, so it could be that even with this it doesn't work, but enabling Jade+ xacro would be the first step.


Edit: hm, according to wiki/xacro - Default parameters, this should already be supported in Indigo. Not sure what is going on then.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-02-08 03:55:41 -0500

Seen: 165 times

Last updated: Feb 08 '18