I am working on a project that utilizes a SLAM algorithm with our BlueROV2, which is equipped with a Navigator flight controller.
For our SLAM implementation to perform accurately, we require both the gyroscope and accelerometer data streams to have a consistent output rate of over 200Hz.
Our current setup uses the primary, on-board ICM20602 IMU. After reviewing the ICM20602 datasheet, I’ve noted that the sensor’s data output rate is primarily controlled by the SMPLRT_DIV register.
My question is: Which ArduPilot parameter is responsible for configuring the sample rate of the ICM20602 IMU?
I have searched through the full parameter list but have been unable to definitively identify the parameter that adjusts the backend sample rate for this specific IMU. Just to note, available bandwidth is not a concern for our application.
Any guidance on which parameter to modify would be greatly appreciated.
Hi @MIguel -
Welcome to the forums!
You should be able to have the gyro, and indeed all the motion sensors and the EKF output at that 200Hz no problem! The parameter you’re after is loop_rate - I believe this is already set to 200Hz by default on ArduSub!
You should be able to poll this data with pymavlink, or perhaps more easily with Mavlink2Rest!
Well, you are correct about SCHED_LOOP_RATE parameter. However, I need to get the message of SCALED_IMU2 beetween 200 ~ 400 Hz, and apparently the SCHED_LOOP_RATE isn’t responsible of how fast the mavlink messages are sended out. On mavlink2rest, at this time, my SCALED_IMU2 is being output at 2 Hz frequency:
Hi @MIguel -
That’s correct, but it should be available to respond to queries that fast! Have you tried requesting it at your desired route via a script, rather than the Mavlink2Rest monitor there?
Thanks for the suggestion. I haven’t tried using a separate script to request the data.
This is because I’m using MAVROS in my ROS2 setup. This package directly transforms the MAVLink messages it receives into ROS topics. I’ve observed that the ROS topic rates match the MAVLink message rates shown in MAVLink2Rest. For instance, the /mavros/imu/data_raw topic has the same update rate as the SCALED_IMU2 message stream.
Therefore, I believe I need to directly change the output streaming rate of the MAVLink messages from the flight controller, as this seems to be the only way to get the topic data in ROS2 at 200Hz.
Is there a specific parameter in ArduSub that can do this, or will I have to go another route to solve this?