0
$\begingroup$

Rosanswers logo

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.


Originally posted by Tom Moore on ROS Answers with karma: 13689 on 2014-09-04

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by hsu with karma: 5780 on 2014-09-05

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Tom Moore on 2014-09-05:
I believe I tracked it down and fixed it:

https://github.com/ros-simulation/gazebo_ros_pkgs/pull/238 https://github.com/ros-simulation/gazebo_ros_pkgs/pull/239

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.