Ask Your Question
1

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

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

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
1

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

Orhan gravatar image

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

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: https://github.com/jonnydark/ros_wheel_speeds

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

edit flag offensive delete link more

Comments

@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 imagesajal ( 2019-05-31 01:17:42 -0500 )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 imageOrhan ( 2019-05-31 02:12:31 -0500 )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 imagesajal ( 2019-05-31 12:16:25 -0500 )edit

Yes. It would work.

Orhan gravatar imageOrhan ( 2019-06-02 20:55:11 -0500 )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 imagesajal ( 2019-06-04 08:37:16 -0500 )edit

http://wiringpi.com/download-and-install/ and

https://raspberrypi.stackexchange.com/questions/68297/linking-wiringpi-library-in-cmakelists

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

Orhan gravatar imageOrhan ( 2019-06-08 02:51:52 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 67 times

Last updated: May 30