-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
Sub: support ABOVE_TERRAIN frame in GUIDED mode posvel case #27767
base: master
Are you sure you want to change the base?
Conversation
Very interesting I'm working on something similar for Plane. Here's my draft PR for plane #27909 |
@timtuxworth Thanks for reaching out! I will read your PR and try to stay in sync where I can. My use case doesn't depend on a GCS, instead I am using a Lua script to send targets at 10Hz. This allows the sub pilot to control heading while GUIDED mode handles the xyz motion. Here is the script that I am testing: https://github.com/clydemcqueen/ardusub_surftrak/blob/guided_above_terrain/lua/transect.lua |
@@ -178,6 +178,7 @@ struct PACKED log_GuidedTarget { | |||
LOG_PACKET_HEADER; | |||
uint64_t time_us; | |||
uint8_t type; | |||
uint8_t alt_frame; |
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.
Have you thought about making this a Location::AltFrame instead of uint8_t?
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.
Hmmm, will all compilers map Location::AltFrame to uint8_t? I don't see this usage anywhere else in the code.
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've used a static cast - oh I see what you've done. Makes sense.
7efb8f8
to
d91a3a7
Compare
We tested this w/ an A50 DVL off Seattle's Pier 62 on 21-Aug-2024 with good success. Learnings:
We will test again in a few weeks. |
d91a3a7
to
35a723a
Compare
We tested this on a different ROV with an A50 DVL off a vessel in Elliott Bay. I still saw vertical oscillations in guided mode compared to surftrak. I tracked this down how We will test this again in the coming weeks. |
Sub Guided_PosVel mode currently assumes
Location::AltFrame::ABOVE_ORIGIN
. This PR adds support forLocation::AltFrame::ABOVE_TERRAIN
.This new functionality is exposed two ways:
SET_TARGET_POSITION_GLOBAL_INT.frame = MAV_FRAME_GLOBAL_TERRAIN_ALT_INT
set_target_posvel_terrain(Vector3f, Vector3f)
The motivation is to allow the development of scripts that drive the ROV at a constant xy velocity and at a constant height above the seafloor, while giving the pilot control over heading. There's a new autotest that demonstrates this.
Possible open issues / future PRs:
set_target_posvel_NED(Vector3f, Vector3f)
Lua binding?Location::AltFrame::ABOVE_TERRAIN
, though this mode does not support rapid target updates