-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Log vehicle local position setpoints for fixedwing position control #18929
Conversation
This commit enables the local position setpoints to be logged by publishing vehicle_local_position_setpoint
if (_global_local_proj_ref.isInitialized()) { | ||
Vector2f current_setpoint = _global_local_proj_ref.project(current_waypoint.lat, current_waypoint.lon); | ||
vehicle_local_position_setpoint_s local_position_setpoint{}; | ||
local_position_setpoint.x = current_setpoint(0); |
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.
populate the unused fields with NANs?
local_position_setpoint.vx = NAN
, etc
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.
Alternatively does populating any other existing data make sense (for casual interest)?
- acceleration from L1?
- velocities from TECS (remove wind?)
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 think for now IMO there is not much more to add - e.g. velocity setpoints are not used byt the controller / accelerations are not used by the controller. I think we can add these by cleaning up the controller one by one (e.g. change L1 controller to command accelerations, rather than roll angles)
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.
Some stuff - e.g. lateral acceleration- will be published with the new L1 controller (#18810) in npfg_status. I would also find it nicer if we publish whatever we can in local_position_setpoint. That though also requires some controller interface alignment - using local coordinates prob is one thing of that.
Looks good, although doesn't this need to be skipped during VTOL transitions? |
@dagar Done! Happy new year! 🎉 |
This commit adds disabling vehicle setpoints while in transition
3f892ea
to
30a3ca9
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.
Thanks, that makes sense.
Let's figure out if it makes sense to pull some more data out of tecs_status and npfg_status into vehicle_local_position setpoint.
if (_global_local_proj_ref.isInitialized()) { | ||
Vector2f current_setpoint = _global_local_proj_ref.project(current_waypoint.lat, current_waypoint.lon); | ||
vehicle_local_position_setpoint_s local_position_setpoint{}; | ||
local_position_setpoint.x = current_setpoint(0); |
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.
Some stuff - e.g. lateral acceleration- will be published with the new L1 controller (#18810) in npfg_status. I would also find it nicer if we publish whatever we can in local_position_setpoint. That though also requires some controller interface alignment - using local coordinates prob is one thing of that.
Fully agreed! I think now that we have two controllers we can use this as an opportunity to clean up the controller interface |
Describe problem solved by this pull request
Previously it was hard to interpret what the fw position controller was doing in term of tracking performance since the position setpoints were not logged in the local frame.
Describe your solution
This adds publication of the
vehicle_local_position_setpoint
so that it gets logged as a local setpoint.Describe possible alternatives
Test data / coverage
Tested in SITL Gazebo
and the log correctly shows the position setpoints and how the waypoints are switching.
Before PR: FlightLog
After PR: Flightlog
Additional context