Robotics StackExchange | Archived questions

Publishing IMU data from executable

I am using a Pololu - MinIMU-9 v5 with the provided programme (https://github.com/DavidEGrayson/minimu9-ahrs) 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

Asked by ip2g15 on 2019-04-14 09:13:39 UTC

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

Asked by Reamees on 2019-04-17 03:13:26 UTC

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_pi_imu_publisher.git

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?

Asked by ip2g15 on 2019-04-17 10:03:30 UTC

Answers