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

Can i use raspberry pi to calculate odometry and publish over ROS?

asked 2019-05-30 05:02:41 -0600

sajal gravatar image

I want to get odometry data from Rpi using GPIO pins (connected to motor controller and encoders) without arduino and publish it on ROS. Is there any tutorial or code available for that.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-05-30 07:34:16 -0600

Orhan gravatar image

updated 2019-05-30 07:35:08 -0600

Yes you can.

You can start by this if you haven't already done reading: Publishing Odometry Information over ROS

  1. Here's an example repository that reads encoders with rpi:

  2. Computing Odometry from two velocities This question and its answer can be interesting for you.

edit flag offensive delete link more


@Orhan Thank you, this was really helpful. In the GitHub link, in which file can I add the pose information and will I have to add build and run depend on "tf" to package.xml (no changes in Cmakelists?) after adding the pose information.

sajal gravatar image sajal  ( 2019-05-31 01:17:42 -0600 )edit

If you read the first link, it points out tf and nav_msgs, you should add both to CMakeLists.txt and package.xml. The main file looks like what you need. It's the file that you get information and publish it to a topic.

Orhan gravatar image Orhan  ( 2019-05-31 02:12:31 -0600 )edit

@Orhan In the odometry example by ROS, they have done it in just one code. So is it fine if I add the encoder data (using wiringpi) and add the formulae for velocities in that code itself and keep the rest same (no change in Cmakelist and package.xml). Will it work? Thank for reply:)

sajal gravatar image sajal  ( 2019-05-31 12:16:25 -0600 )edit

Yes. It would work.

Orhan gravatar image Orhan  ( 2019-06-02 20:55:11 -0600 )edit

@Orhan How and where do I have to install the wiringPi library, I cloned github link in the home folder (then build it) but I'm getting an error during catkin_make of above odometry package = "could not find configuration file provided by wiringPi with names wiringPiConfig.cmake".

sajal gravatar image sajal  ( 2019-06-04 08:37:16 -0600 )edit and

Please prefer googling, instead of asking. This way, you can find information by yourself, faster.

Orhan gravatar image Orhan  ( 2019-06-08 02:51:52 -0600 )edit

Question Tools

1 follower


Asked: 2019-05-30 05:02:41 -0600

Seen: 965 times

Last updated: May 30 '19