kobuki icon indicating copy to clipboard operation
kobuki copied to clipboard

encoder reading

Open ghost opened this issue 6 years ago • 8 comments

Hello,

I am trying to get encoder reading from the kobuki base, but i didn't find any solution yet. Is it possible to get encoder readings rather than odom data?

ghost avatar Jun 22 '18 19:06 ghost

Hi, look for a topic */joint_states, it has the encoder readings.

schmidtp1 avatar Jun 22 '18 21:06 schmidtp1

joint_states doesn't give the encoder reading. I checked it. Is there any other way to get encoder values?

ghost avatar Jun 25 '18 15:06 ghost

The topic has the position. Do you need the increments (/high-low signal)?

schmidtp1 avatar Jun 25 '18 15:06 schmidtp1

yes, it has the position which is same as what i get in odom topic. I want to get the raw encoder reading. i.e. how many ticks is the motor reporting? Is their any way to get it?

ghost avatar Jun 25 '18 16:06 ghost

I see, I'm wondering if the accuracy is sufficient to just divide tick_to_rad(0.002436916871363930187454f) [https://github.com/yujinrobot/kobuki_core/blob/devel/kobuki_driver/src/driver/diff_drive.cpp]. It seems that currently there is no interface for the encoder ticks (neither in ROS nor C++): https://github.com/yujinrobot/kobuki_core/blob/devel/kobuki_driver/include/kobuki_driver/modules/diff_drive.hpp

schmidtp1 avatar Jun 25 '18 16:06 schmidtp1

so, should i divide the pose i get from /odom by 0.002436916871363930187454?

ghost avatar Jun 25 '18 16:06 ghost

Yes, except that I am not aware that there are joint position in the odometry topic (http://docs.ros.org/kinetic/api/nav_msgs/html/msg/Odometry.html):

std_msgs/Header header
string child_frame_id
geometry_msgs/PoseWithCovariance pose
geometry_msgs/TwistWithCovariance twist

In the joint states there is

std_msgs/Header header
string[] name
float64[] position  // <=
float64[] velocity
float64[] effort

(http://docs.ros.org/kinetic/api/sensor_msgs/html/msg/JointState.html)

schmidtp1 avatar Jun 25 '18 16:06 schmidtp1

thanks. I will look into it.

ghost avatar Jun 25 '18 17:06 ghost