Gazebo | Ignition | Community
Ask Your Question

How to specify yaw in a ROS launch file?

asked 2020-05-18 05:16:36 -0600

Py gravatar image

updated 2020-05-20 03:53:30 -0600


I'm having trouble getting my robot to face the right direction when it is spawned in the Gazebo world. Here's what I have in my launch file:

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" output="screen"
      args="-urdf -model clearpath_jackal -param robot_description -x 0 -y -10 -z 1.0 -Y 1.5708" />

Note that I'm trying to use the -Y argument to specify yaw but when I launch Gazebo the robot is always facing the same way, regardless of what value I specify.

Can anybody make any suggestions?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-05-19 09:36:32 -0600

ahcorde gravatar image

updated 2020-05-19 09:36:45 -0600


I have already tested with Gazebo 9 and ROS Noetic and it's working

image description

I run this bash script

for i in 0 1 2 3 4
rosrun gazebo_ros spawn_model -urdf -file model.urdf -x $i -y 0 -z 3.0 -reference_frame world -model drone$i -Y $i

can you provide more details? which Gazebo and ROS version are you using?

edit flag offensive delete link more


Thanks for this. I've played around with your script and it seems to be working fine now with my originally posted launch code.....not sure what happened!

Py gravatar imagePy ( 2020-05-20 05:33:24 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-05-18 05:16:36 -0600

Seen: 112 times

Last updated: May 20