-
Notifications
You must be signed in to change notification settings - Fork 17.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
Enhanced attitude control via scripting #25814
base: master
Are you sure you want to change the base?
Conversation
2bd2a7c
to
c603159
Compare
38ef3e8
to
c616ec2
Compare
@@ -2345,10 +2349,22 @@ function vehicle:get_circle_radius() end | |||
---@return boolean | |||
function vehicle:set_target_angle_and_climbrate(roll_deg, pitch_deg, yaw_deg, climb_rate_ms, use_yaw_rate, yaw_rate_degs) end | |||
|
|||
-- desc |
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.
Full description please.
-- Sets the target velocity using a Vector3f object in a guided mode. | ||
---@param vel_ned Vector3f_ud -- North, East, Down meters / second | ||
---@param align_yaw_to_target? boolean |
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.
---@param align_yaw_to_target? boolean | |
---@param align_yaw_to_target boolean |
It is not optional in lua.
singleton AC_Fence method get_safe_alt_min float | ||
singleton AC_Fence method get_safe_alt_max float | ||
singleton AC_Fence method present uint8_t | ||
singleton AC_Fence method get_enabled_fences 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.
I think the fence stuff should be a separate PR.
@@ -156,6 +156,7 @@ class AP_Motors { | |||
float get_yaw_ff() const { return _yaw_in_ff; } | |||
float get_throttle_out() const { return _throttle_out; } | |||
virtual bool get_thrust(uint8_t motor_num, float& thr_out) const { return false; } | |||
float get_throttle_in() const { return _throttle_in; } |
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.
Why is this needed vs the existing get_throttle
binding?
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.
Motors stuff should probably be its own PR too.
@@ -347,16 +347,24 @@ bool Copter::set_target_posvelaccel_NED(const Vector3f& target_pos, const Vector | |||
return mode_guided.set_destination_posvelaccel(pos_neu_cm, vel_neu_cms, accel_neu_cms, use_yaw, yaw_deg * 100.0, use_yaw_rate, yaw_rate_degs * 100.0, yaw_relative); | |||
} | |||
|
|||
bool Copter::set_target_velocity_NED(const Vector3f& vel_ned) | |||
bool Copter::set_target_velocity_NED(const Vector3f& vel_ned, bool align_yaw_to_target) |
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.
It would definitely be nice to be able to control the yaw better from scripting
won't this break the API though for existing users?
allow vehicles to yaw to target docs for set_target_velocity_NED() add set_target_angle_and_thrust() and get_throttle_in()
add set_target_angle_and_thrust()
allow scripting to call set_angle with thrust
c616ec2
to
42d33af
Compare
Based on #25698