-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCS_MAVLink: support HIGHRES_IMU #27007
GCS_MAVLink: support HIGHRES_IMU #27007
Conversation
6f084c1
to
5f796f3
Compare
676295f
to
49bbb25
Compare
a2e7e10
to
5b841dc
Compare
Thanks for all the (really quick!) suggestions and improvements :-) I am open for discussing this more :) |
5b841dc
to
5508021
Compare
do you want the mag, baro airspeed data etc? |
5508021
to
672483d
Compare
Yes, I want it. It is used in outdoor applications for SLAM etc. |
4c15754
to
d0d162f
Compare
@tridge @peterbarker @magicrub I have implemented your improvements (by amending the commit) and think this PR is mergeable. |
12f1ee2
to
62eb4d0
Compare
62eb4d0
to
a2dd3c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only other concern would be "built in to 2MB boards or not by default".
But otherwise LGTM
4ce410e
to
e3c2c4c
Compare
What's the difference between |
@shubham-shahh
|
Thanks for the detailed response. |
I don't know if I understand your comment correctly. So there is no additional special care taken to transmit the messages within one mavlink frame. So the functionality I am looking for is to get all IMU values, in full resolution, without rounding at one point in time with timestamp for processing on a companion computer. I am not the only one profiting from this inclusion (#24258), I think it is good if ardupilot tries to support the MAVLink protocol as good as possible. If you'd like we can talk about the changes if you are unsure they are necessary/wrongly implemented. |
No, What I meant is, since these values are meant to be uitlised by Intertial SLAM algorithms, I was trying to understand in terms of the transformations that are already applied to these values to be considered while calibrating the Extrensics and also understanding when are these messages stamped since time sync is also a critical aspect when fusing these values for localisation. |
I am not a pro regarding SLAM or MAVLink, but as far as I understand there are several systems in mavlink which read the sensors and update the values with no way of knowing how 'old'/'new' respective values are. When the answer to the Doing SLAM integrating accelerometer values etc. is problematic in itself because the poll rate going through OS -> MavLink -> Uart -> Mavlink -> Ardupilot is pretty limiting. Regarding transformations of values, they are transformed using the calibration and conversion formulars of the sensors. This is important to abstract the sensor specific code and calibrations away. The values are not only/really used for SLAM. They are important for aligning data from the flight (altitude, acceleration, heading, ...) with data from other measurement systems controlled by the companion computer. I cannot go into the details on how the signal processing is going to work and it is also not important for this particular PR. Imagine a big measurement system on a UAV, with ardupilot just acting as a sensor, providing a set of values. Those values need to be as accurate as possible and without sensor specific offsets/scalings. |
e3c2c4c
to
6299c47
Compare
I think you're asking whether the IMU data is translated to avoid any lever-arm effect. It is. |
HIGHRES_IMU MAVLink message. Built in to 2MB boards or not by default.
6299c47
to
b159ecc
Compare
We really do need to think about sending data in this message like we do for SCALED_IMU. That is, we should be sending data from the second compass and baro, rather than just sending from the first healthy instance of each. |
@KoehlerT we've merged this so people have something to iterate on, but if you could consider PR'ing something which gets us all of the sensor data that would be good. It would be nice to be able to sunset RAW_IMU and SCALED_IMU messages. |
I think it should be removed from "ap_message.h". PS: 4.5.6 stable + cherry-pick version
|
I tested the master branch for the HighRes IMU feature in SITL. While the MAVLink message structure is set up, ArduPilot is not currently publishing the message, as it's not visible in the MAVLink Inspector on QGC. I have a couple of suggestions in mind to address this and more other to discuss:
Additional comment: Please let me know what you guys think in regard to the above concerns. |
Did you try 100Hz or 200Hz setup in SITL? As I have found that it can't be set 100Hz in Rover. |
Is it possible to request the HIGHRES_IMU data? With code like e.g. this? import time
# Import mavutil - Install the dependency if not installed
from pymavlink import mavutil
# Create the connection
master = mavutil.mavlink_connection('COM15',baud=57600)
# Wait a heartbeat before sending commands
master.wait_heartbeat()
# Request all parameters
def request_message_interval(message_id: int, frequency_hz: float):
master.mav.command_long_send(
master.target_system, master.target_component,
mavutil.mavlink.MAV_CMD_SET_MESSAGE_INTERVAL, 0,
message_id, # The MAVLink message ID
1e6 / frequency_hz, # The interval between two messages in microseconds.
0, 0, 0, 0, # Unused parameters
0, # Target address of message stream 0: Flight-stack default (recommended)
)
request_message_interval(mavutil.mavlink.MAVLINK_MSG_ID_HIGHRES_IMU, 100)
while True:
try:
imu = master.recv_match(type='HIGHRES_IMU', blocking=True)
print("imu: " +str(imu))
except Exception as e:
print(repr(e))
time.sleep(1) I am currently working on getting SITL working for myself |
Hi, I want to ask what's the difference between As I have ported this PR back to 4.5.6, I'm NOT sure if it will make a mess. |
My main aim to do this from OBC, which already uses MAVROS to communicate to FCU. I figured that out that one can use @KoehlerT , let me know your thoughts on Timestamping HighRes IMU msg frame with the inertial sensor’s last update timestamp. |
Duplicates #24258
It allows a companion computer to query the flightcontrollers IMU for navigation and control.
This PR implements all fields for the HIGHRES_IMU Mavlink message.