mirror of https://github.com/ArduPilot/ardupilot
Rover: implement get_steering_and_throttle
This commit is contained in:
parent
651e5ec62a
commit
2808323a14
|
@ -204,6 +204,14 @@ bool Rover::set_steering_and_throttle(float steering, float throttle)
|
|||
return true;
|
||||
}
|
||||
|
||||
// get steering and throttle (-1 to +1) (for use by scripting)
|
||||
bool Rover::get_steering_and_throttle(float& steering, float& throttle)
|
||||
{
|
||||
steering = g2.motors.get_steering() / 4500.0;
|
||||
throttle = g2.motors.get_throttle() * 0.01;
|
||||
return true;
|
||||
}
|
||||
|
||||
// set desired turn rate (degrees/sec) and speed (m/s). Used for scripting
|
||||
bool Rover::set_desired_turn_rate_and_speed(float turn_rate, float speed)
|
||||
{
|
||||
|
|
|
@ -257,6 +257,7 @@ private:
|
|||
bool set_target_location(const Location& target_loc) override;
|
||||
bool set_target_velocity_NED(const Vector3f& vel_ned) override;
|
||||
bool set_steering_and_throttle(float steering, float throttle) override;
|
||||
bool get_steering_and_throttle(float& steering, float& throttle) override;
|
||||
// set desired turn rate (degrees/sec) and speed (m/s). Used for scripting
|
||||
bool set_desired_turn_rate_and_speed(float turn_rate, float speed) override;
|
||||
bool set_desired_speed(float speed) override;
|
||||
|
|
Loading…
Reference in New Issue