ROS2- passing arguments with launch.py file not working
Hi Folks,
I am trying to launch nodes with launch.py
in ros2. Nodes are getting launched but I am facing issue with arguments passing.
My Code snippet:
launch_ros.actions.Node(
package='tf2_ros', node_executable='static_transform_publisher',node_name='bl_imu', output='screen',
#arguments=['-0.07' '0' '0' '3.14159' '0' '0' 'base_link' 'laser' '100']),
#arguments=['--x','-0.07', '--y', '0', '--z', '0', '--qx', '3.14159', '--qy', '0', '--qz' ,'0', '--qw','1.570796327','-- #frame_id','base_link','--child_frame_id','imu_link']),
I would like to pass arguments to this node static_transform_publisher
.
I tried above two ways but getting error with this specific node.
[ERROR] []: static_transform_publisher exited due to not having the right number of arguments
A command line utility for manually sending a transform.
Usage: static_transform_publisher x y z qx qy qz qw frame_id child_frame_id
OR
Usage: static_transform_publisher x y z yaw pitch roll frame_id child_frame_id
[ERROR] [launch]: process[static_transform_publisher-1] process has died [pid 7074, exit code 255, cmd '/opt/ros/bouncy/lib/tf2_ros/static_transform_publisher __node:=bl_imu'].
Please let me know if anybody has tried this or any suggestions.
Thanks, Poonam
I am also running into this issue. I tried passing the arguments as a single string (
arguments='0 0 0 0 0 0 1 world cam'
), but extra spaces were inserted (cmd '/opt/ros/bouncy/lib/tf2_ros/static_transform_publisher 0 0 0 0 0 0 1 w o r l d c a m'
).Hi,
I am able to pass this via command line as below and it works.
ros2 run tf2_ros static_transform_publisher 0 -0.3 0.52 -1.570796327 0 1.570796327 base_link imu_link
but i would like to do the same from launc.py file
Thanks, poonam
Yes, I am experiencing the same problem.