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

How to assign xacro arguments to xacro macro parameters?

asked 2021-07-17 02:23:59 -0500

electrophod gravatar image

I am initialising a macro in my xacro file as <xacro:macro name="sensor_d435" params="name:=realsense_d435_camera topics_ns:=realsense_d435 parent *origin">.

I have a xacro argument with the name robot_namespace in my launch file. I want to assign it to the topics_ns while initializing my macro, something like: topics_ns:=$(arg robot_namespace). When I do this and launch my original launch file, I get an error saying invalid expression: $(arg

Probably, it is seeing $(arg and robot_namespace) as 2 different and separate parameters. Any way how I can achieve what I want?

TIA

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-07-19 21:58:46 -0500

electrophod gravatar image

updated 2021-07-19 21:59:20 -0500

I raised an issue regarding this on xacro's GitHub and a kind developer created a PR for this feature request. It has now been merged. I hope now it will be possible to assign argument names to macro parameters. Thank you, community!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-07-17 02:23:59 -0500

Seen: 201 times

Last updated: Jul 19 '21