Publishing IMU data from executable

asked 2019-04-14 09:13:39 -0500

ip2g15 gravatar image

I am using a Pololu - MinIMU-9 v5 with the provided programme ( https://github.com/DavidEGrayson/mini... ) to get the data on a Raspberry PI 3b. I can run the minimu9-ahrs --output euler command on a terminal and the estimated angles from the IMU are printed on the screen. This command runs an executable file that is compiled from the mentioned programme, and by visual inspections the printed angles are very good. Is there a way to run to call this executable in a ROS node, access the printed values and then publish the pitch angle? Thanks

edit retag flag offensive close merge delete

Comments

You could use the python module subprocess or os.popen to pipe the output of the program to your python node and test things out. It's not going to be fast or efficient, in the end you might want to consider porting the relevant parts for running the imu to a ros node. It would also be a good idea to do some googling on what other people have already done. Some links I found by doing a bit of googling.

https://github.com/BruinBear/minimuv5_pi_imu_publisher

http://treesblogger.blogspot.com/2016/08/reading-serial-imu-data.html

piping program output to python - not a long term solution

Reamees gravatar image Reamees  ( 2019-04-17 03:13:26 -0500 )edit

Thank you for your answer! I am trying to create the package from the github repository that you provided in the following way:

i navigate to catkin_ws/src and then:

git clone https://github.com/BruinBear/minimuv5...

once this is done i am trying to catkin_make but i get an error:

add_custon_target cannot create target "sensor_msgs_generate_messages_py" because another target with the same name already exists. The existing target is a custom target created in source directory "/home/pi/catkin_ws/src/minimuv5_pi_imu_publisher"

Do you know what i m doing wroing?

ip2g15 gravatar image ip2g15  ( 2019-04-17 10:03:30 -0500 )edit