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

How can i change the initial orientation of a robot when using roslaunch?

asked 2020-10-20 10:52:45 -0500

Qilos gravatar image

Hello, I launched a robot into my own gazebo world and noticed it was facing the wall, so i need to turn the robot 180° when initializing.

In my launch file i found this part here:

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
args="-param robot_description -urdf -x -0.5 -y 1 -z 0.05 -model pepper_MP" />

But there is nothing said about the orientation, so i wonder what i need to add so that my robot faces the right direction when initiialized

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2020-10-20 12:13:38 -0500

usage: spawn_model [-h] (-urdf | -sdf)
                   (-file FILE_NAME | -param PARAM_NAME | -database MODEL_NAME | -stdin)
                   -model MODEL_NAME [-reference_frame REFERENCE_FRAME]
                   [-gazebo_namespace GAZEBO_NAMESPACE]
                   [-robot_namespace ROBOT_NAMESPACE] [-unpause]
                   [-wait MODEL_NAME] [-x X] [-y Y] [-z Z] [-R R] [-P P]
                   [-Y Y] [-J JOINT_NAME JOINT_POSITION] [-package_to_model]
                   [-b]

R, P, and Y stand for roll pitch and yaw. Yaw is what you want. Hence:

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
args="-param robot_description -urdf -x -0.5 -y 1 -z 0.05 -Y 3.1416 -model pepper_MP" />
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-10-20 10:52:45 -0500

Seen: 1,134 times

Last updated: Oct 20 '20