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

How to make my own base controller publish /odom?

asked 2012-10-08 18:58:06 -0500

bobliao gravatar image

I have no robot, so I must build one piece by piece. I use differential drivers ,each with a encoder.And each encoder can output two channels signal :A,B.

I can read channel A and B to aquire the speed and direction of a motor through Arduino device.

But how can I integrate the signal from the two encoders with the topic of /odom with the lowest level device Arduino? If this is done by Arduino ,I doubt the ability of an 8-bit processor. so is there any relevent reference about it?

i have check the detail of msg /odom:

rosmsg show nav_msgs/Odometry 
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
string child_frame_id
geometry_msgs/PoseWithCovariance pose
  geometry_msgs/Pose pose
    geometry_msgs/Point position
      float64 x
      float64 y
      float64 z
    geometry_msgs/Quaternion orientation
      float64 x
      float64 y
      float64 z
      float64 w
  float64[36] covariance
geometry_msgs/TwistWithCovariance twist
  geometry_msgs/Twist twist
    geometry_msgs/Vector3 linear
      float64 x
      float64 y
      float64 z
    geometry_msgs/Vector3 angular
      float64 x
      float64 y
      float64 z
  float64[36] covariance

thank you very much!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-10-09 01:51:03 -0500

dornhege gravatar image

The first step would be to get encoders ticks -> wheel velocity for the left and right wheel. Besides the tick count/motor revolutions this obviously depends on the wheel diameter.

Next, convert left/right velocity to translational and rotational velocity. Google should give you some simple formulas using the wheel base.

Given the measured time between two odometry readings, you now get a delta in translation and orientation that you can add to your last send odometry.

You can use this information to fill out the message.

edit flag offensive delete link more

Question Tools


Asked: 2012-10-08 18:58:06 -0500

Seen: 1,099 times

Last updated: Oct 09 '12