Getting Euler angles to publish at 255Hz from the um7_driver

asked 2016-08-12 16:10:49 -0500

wmrifenb gravatar image

Hello,

I would like to have the um7_driver publish its /imu/rpy topic at the highest rate possible (255Hz). To do this I have modified line 166 of the main.cpp from this:

private_nh->param<int>("update_rate", rate, 20);

to this:

private_nh->param<int>("update_rate", rate, 255);

And I have used CH Robotics' Serial Interface program to change the Euler Angle Publish rate to 255Hz

When I start the um7_driver it tells me its running at 255Hz:

[ INFO] [1471034280.126928398]: um7_driver successfully connected to serial port /dev/ttyUSB0.
[ INFO] [1471034280.131541907]: Received packet 02 without data.
[ INFO] [1471034280.133519679]: Setting update rate to 255Hz
[ INFO] [1471034280.137407860]: Received packet 02 without data.
[ INFO] [1471034280.143123357]: Received packet 04 without data.
[ INFO] [1471034280.149176752]: Received packet 05 without data.
[ INFO] [1471034280.159062327]: Received packet 06 without data.
[ INFO] [1471034280.165085744]: Received packet 08 without data.
[ INFO] [1471034280.165672434]: Sending command: zero gyroscopes
[ INFO] [1471034280.573718137]: Received packet ad without data.

However, 'rostopic hz' tells me that the data is being published at only around 45 Hz:

will@ubuntu:~/evae_ws/src/um7/src$ rostopic hz /imu/rpy 
subscribed to [/imu/rpy]
average rate: 46.627
    min: 0.011s max: 0.040s std dev: 0.01241s window: 43
average rate: 46.173
    min: 0.011s max: 0.040s std dev: 0.01235s window: 90
average rate: 45.560
    min: 0.011s max: 0.058s std dev: 0.01265s window: 135

What gives? Am I doing something wrong?

Thanks for the help!

edit retag flag offensive close merge delete

Comments

Not an answer, but a tip: for values read in as parameters, you don't need to change the source. Just start the node with a private parameter called update_rate set to the desired value. Changing source for these kinds of things is rarely necessary, and is exactly why parameters exist.

gvdhoorn gravatar image gvdhoorn  ( 2016-08-13 03:33:36 -0500 )edit