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

Coordinate frames in set_model_state topic with gazebo_ros

asked 2014-09-04 08:24:42 -0600

Tom Moore gravatar image

updated 2014-09-04 08:25:16 -0600

I am using ROS Indigo with gazebo 4.0.1 as installed by the ros-indigo-gazebo4-prerelease-* packages. I am trying to use the set_model_state topic to move a Pioneer 2DX model around. The model contains the following frames:

  • chassis
  • right_wheel
  • left_wheel
  • right_wheel_hinge
  • left_wheel_hinge

First, I issue the following command:

rostopic pub /gazebo/set_model_state gazebo_msgs/ModelState "model_name: 'pioneer2dx'
pose:
  position:
    x: 0.0
    y: 0.0
    z: 0.0
  orientation:
    x: 0.0
    y: 0.0
    z: 0.0
    w: 0.0
twist:
  linear:
    x: 0.0
    y: 0.0
    z: 0.0
  angular:
    x: 0.0
    y: 0.0
    z: 0.1
reference_frame: 'chassis'"

The robot correctly begins to turn counter-clockwise. After it turns some nontrivial amount, I then issue a second command to stop it. I then issue this command:

rostopic pub /gazebo/set_model_state gazebo_msgs/ModelState "model_name: 'pioneer2dx'
pose:
  position:
    x: 0.0
    y: 0.0
    z: 0.0
  orientation:
    x: 0.0
    y: 0.0
    z: 0.0
    w: 0.0
twist:
  linear:
    x: 0.4
    y: 0.0
    z: 0.0
  angular:
    x: 0.0
    y: 0.0
    z: 0.0
reference_frame: 'chassis'"

My expectation is that the robot will move forward in the direction that it is currently facing. This is why I issued the command in the chassis frame. However, the robot instead starts moving forward along the X-axis in the world coordinate frame.

I have verified this with a second robot model (my own), and assumed I did something wrong with my model until the same issue appeared with the P2DX. Is this working as intended, or is it a bug? I can easily convert the desired drive command to the "correct" reference frame, but it seems as though the robot ought to be able to accept commands to drive in its body coordinate frame.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-09-05 13:04:14 -0600

hsu gravatar image

Thanks for the report. Can you file an issue in gazebo_ros_pkgs issue tracker?

edit flag offensive delete link more

Comments

I believe I tracked it down and fixed it:

https://github.com/ros-simulation/gaz...https://github.com/ros-simulation/gaz...

I'll add an issue and then refer to the PRs.

Tom Moore gravatar image Tom Moore  ( 2014-09-05 13:12:24 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-09-04 08:24:42 -0600

Seen: 1,091 times

Last updated: Sep 05 '14