-
Notifications
You must be signed in to change notification settings - Fork 97
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
mocap: add SetVisionSpeedEstimate #361
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for the pull request! Just one question regarding a comment.
protos/mocap/mocap.proto
Outdated
// Global speed estimate from a vision source. | ||
message VisionSpeedEstimate { | ||
uint64 time_usec = 1; // PositionBody frame timestamp UNIX Epoch time (0 to use Backend timestamp) | ||
SpeedBody speed_body = 2; // Global speed (m/s) |
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.
Just wondering on the frame here? When you see "Global" do you mean in North, East, Down, or Forward, Left, Down? I'm pretty sure "Body" would imply in body frame, so Forward, Left, Down.
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.
Hi @julianoes! Thanks for the review!
I used the same description as in the MAVLink doc, but I guess this is a typo.
However, I see in the VisionPositionEstimate a similar case:
PositionBody position_body = 2; // Global position (m)
Should I fix it too?
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.
Interesting. Might be worth checking what PX4 expects and whether we should update the MAVLink messages description.
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.
For position, PX4 expects NED:
I don't see vision speed being used in PX4. How are you testing this?
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.
Actually, we are currently testing with ArduPilot.
We used Intel RealSense T265 as an example (see https://ardupilot.org/copter/docs/common-vio-tracking-camera.html).
I suggest changing the "Global speed (m/s)" comment to "Body speed (m/s)"
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.
Thanks @fed12345 and @julianoes, I added a SpeedNed struct.
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.
Hello,
Just as a quick follow-up to this:
I'm tempted to rename the PositionBody type to PositionNed to make it clear...
To us it also seems like a good idea, should we do it in another PR or would it fly to add it in this one?
Aside from that, is there anything else that we should take care of?
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.
Thanks, sorry, I'll get back to this asap.
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.
I looked into it but was very confused by the fact that ArduPilot just handles local and global the same way. That doesn't really make sense to me, but anyway, I think you're right that both handle it NED, and so we should probably rename the field PositionBody
to PositionNed
.
Ardupilot does not differentiate between local(FRD) and global(NED) frame as it doesn't have a local frame, so it interprets the position in global frame. In fact, it processes the messages VISION_POSITION_ESTIMATE and GLOBAL_VISION_POSITION_ESTIMATE the same way, see here
It would have to differentiate between FRD and NED, as they are not the same! But you are saying it just does NED anyway? I couldn't tell from the code snippet.
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.
The code snippet only shows that whether ardupilot receives the VISION_POSITION_ESTIMATE
or the GLOBAL_VISION_POSITION_ESTIMATE
message from Mavlink, it still processes the message with the function handle_common_vision_position_estimate_data
, so it doesn't care if it's global or local.
I also agree that this whole thing is confusing. This is how I interpret the frames:
Global: Latitude and longitude, GPS stuff
NED: Origin at initialization of Kalman Filter, yaw aligned with North
Local FRD: Origin at initialization of Kalman Filter, yaw aligned with front of the drone
Body FRD: Origin at cog of drone, yaw aligned with front of the drone
Ardupilot does not have a concept of Local FRD only body FRD.
64239d8
to
f6ec875
Compare
Co-authored-by: miodine <[email protected]>
Hi, we would like to add the VISION_SPEED_ESTIMATE (103) MAVLink message to the mocap proto.
See https://mavlink.io/en/messages/common.html#VISION_SPEED_ESTIMATE
Relates to issue mavlink/MAVSDK#2497