Wheel velocity value from /gazebo/get_link_state doesn't make sense

asked 2016-11-07 02:15:07 -0500

jsax gravatar image

Hello everyone, I am trying to extract the revolution speed of wheels in a model (currently testing on Husky).

I am using a service call like so:

rosservice call /gazebo/get_link_state '{link_name: front_left_wheel_link, reference_frame: base_link}'

Then expected that the Twist.Angular.Y value should have the relevant value, since it is supposed to be 'relative' to base_link, which is the main body of the robot.

However, depending on which direction the car is pointed when it is moving, this value changes! Observe below (I have converted the values by 180/pi for easier reading)

Orientation [0,0,0]:  AngularVel: [-8.734739493554358, -56.642337057799274, -8.734739493554358]
Orientation [0,0,180]: AngularVel: [-5.098715962240466, -57.07176055502497, -5.098715962240466]
Orientation [0,0,90]: AngularVel: [-0.557856311097797, 57.29304628577577, -0.557856311097797]
Orientation [0,0,-90]: AngularVel: [-1.5030119313830763, 57.28382907589744, -1.5030119313830763]

Can someone please inform me how to extract the true revolution speed of a wheel (that should be constant regardless of direction the car is travelling in!)

edit retag flag offensive close merge delete

Comments

Have you tried scoping the reference link name? `model_name::link_name`, as explained in this tutorial: http://gazebosim.org/tutorials?tut=ros_comm

chapulina gravatar imagechapulina ( 2016-11-07 10:18:46 -0500 )edit

chapulina: same behavior confirmed even after adding scope as follows: rosservice call /gazebo/get_link_state '{link_name: "robot::front_left_wheel_link", reference_frame: "robot::base_link"}'

jsax gravatar imagejsax ( 2016-11-07 10:29:56 -0500 )edit

How about using the `get_joint_properties` service to get the joint position? http://docs.ros.org/kinetic/api/gazebo_msgs/html/srv/GetJointProperties.html

chapulina gravatar imagechapulina ( 2016-11-07 11:00:48 -0500 )edit

I tried GetJointProperties and it just gives 'position' which just keeps incrementing forever, and 'rate' which appears to be the same value as in the /joint_states topic, which as far as I can tell is just the velocity command I am pushing to the joint, since it never slows down when the wheels do.

jsax gravatar imagejsax ( 2016-11-07 15:13:41 -0500 )edit

Is there anyway to force wheel slow down via some object in the simulator? I have tried to place obstacles but can't tell if the wheels are slowing down or not (in order to test if the 'rate' field in /joint_states is accurate or not?

jsax gravatar imagejsax ( 2016-11-08 01:36:08 -0500 )edit

Maybe make a ramp which the robot can't climb completely?

chapulina gravatar imagechapulina ( 2016-11-08 10:41:19 -0500 )edit

Tried this, unfortunately no matter if the robot 'stalls' and flips over from the steepness, the joint velocities advertised seem to remain around 0.99 ~ 1.00 regardless. I'm not sure if this is an issue with Gazebo not slowing down the wheels or because its the wrong topic...

jsax gravatar imagejsax ( 2016-11-08 12:37:48 -0500 )edit

Perhaps it has something to do with the Husky's wheels being too powerful, I did notice it can easily scale very steep ramps. Can you recommend me a different robot package on ros/gazebo that will be stopped by obstacles?

jsax gravatar imagejsax ( 2016-11-08 12:57:16 -0500 )edit