DUNE: Uniform Navigational Environment
2019.02.1
|
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
void | onUpdateParameters (void) |
void | onEntityReservation (void) |
void | onEntityResolution (void) |
void | onActivation (void) |
void | onDeactivation (void) |
void | reset (void) |
void | setup (void) |
void | onResourceInitialization (void) |
void | consume (const IMC::Abort *msg) |
void | consume (const IMC::EstimatedState *msg) |
void | consume (const IMC::DesiredHeading *msg) |
void | consume (const IMC::DesiredSpeed *msg) |
void | consume (const IMC::ControlLoops *msg) |
void | consume (const IMC::Rpm *msg) |
float | rpmToThrust (float rpm, float desired_rpm, double timestep) |
float | mpsToRpm (float vel, double timestep) |
void | dispatchThrust (float value, double timestep, uint8_t id) |
bool | thrustForward (float yaw_err) |
void | shareSaturation (void) |
void | onMain (void) |
Public Attributes | |
DiscretePID | m_rpm_pid |
DiscretePID | m_mps_pid |
DiscretePID | m_yaw_pid |
IMC::ControlParcel | m_parcel_mps |
IMC::ControlParcel | m_parcel_rpm |
IMC::ControlParcel | m_parcel_yaw |
float | m_desired_yaw |
float | m_desired_speed |
uint8_t | m_speed_units |
Delta | m_delta |
IMC::SetThrusterActuation | m_act [2] |
IMC::SetThrusterActuation | m_last_act [2] |
IMC::Rpm | m_rpm [2] |
float | m_previous_rpm |
bool | m_common |
uint16_t | m_rpm_eid [2] |
uint32_t | m_scope_ref |
Arguments | m_args |
|
inline |
References Control::ASV::HeadingAndSpeed::Arguments::act_diff_max, Control::ASV::HeadingAndSpeed::Arguments::act_max, Control::ASV::HeadingAndSpeed::Arguments::act_ramp, Control::ASV::HeadingAndSpeed::Arguments::eid_port, Control::ASV::HeadingAndSpeed::Arguments::eid_starboard, Control::ASV::HeadingAndSpeed::Arguments::log_parcels, Control::ASV::HeadingAndSpeed::Arguments::max_accel, Control::ASV::HeadingAndSpeed::Arguments::max_rpm, Control::ASV::HeadingAndSpeed::Arguments::min_rpm, Control::ASV::HeadingAndSpeed::Arguments::mps_ffgain, Control::ASV::HeadingAndSpeed::Arguments::mps_gains, Control::ASV::HeadingAndSpeed::Arguments::mps_max_int, Control::ASV::HeadingAndSpeed::Arguments::rpm_eos, Control::ASV::HeadingAndSpeed::Arguments::rpm_ffgain, Control::ASV::HeadingAndSpeed::Arguments::rpm_gains, Control::ASV::HeadingAndSpeed::Arguments::rpm_hardware, Control::ASV::HeadingAndSpeed::Arguments::share, Control::ASV::HeadingAndSpeed::Arguments::yaw_gains, and Control::ASV::HeadingAndSpeed::Arguments::yaw_max.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Dispatch to bus SetThrusterActuation message.
[in] | value | set thrust actuation value |
[in] | timestep | amount of time since last control step |
References Control::ASV::HeadingAndSpeed::Arguments::act_max, Control::ASV::HeadingAndSpeed::Arguments::act_ramp, and DUNE::Math::trimValue().
|
inline |
Convert meters per second to a desired rpm value.
[in] | vel | absolute ground velocity. |
[in] | timestep | amount of time since last control step. |
References Control::ASV::HeadingAndSpeed::Arguments::max_accel, Control::ASV::HeadingAndSpeed::Arguments::max_rpm, Control::ASV::HeadingAndSpeed::Arguments::min_rpm, and Control::ASV::HeadingAndSpeed::Arguments::mps_ffgain.
|
inline |
On activation.
|
inline |
On deactivation.
|
inline |
Reserve entities.
References Control::ASV::HeadingAndSpeed::Arguments::log_parcels.
|
inline |
Resolve entities.
References Control::ASV::HeadingAndSpeed::Arguments::eid_port, and Control::ASV::HeadingAndSpeed::Arguments::eid_starboard.
|
inline |
|
inline |
|
inline |
References Control::ASV::HeadingAndSpeed::Arguments::log_parcels, Control::ASV::HeadingAndSpeed::Arguments::mps_ffgain, Control::ASV::HeadingAndSpeed::Arguments::mps_gains, Control::ASV::HeadingAndSpeed::Arguments::mps_max_int, Control::ASV::HeadingAndSpeed::Arguments::rpm_ffgain, Control::ASV::HeadingAndSpeed::Arguments::rpm_gains, Control::ASV::HeadingAndSpeed::Arguments::yaw_gains, and Control::ASV::HeadingAndSpeed::Arguments::yaw_max.
|
inline |
Reset PIDs and actuation references.
|
inline |
Convert rpm value to thrust actuation.
[in] | rpm | value of rpms currently in the motor |
[in] | desired_rpm | desired rpms for the motor |
[in] | timestep | amount of time since last control step |
References Control::ASV::HeadingAndSpeed::Arguments::rpm_eos, Control::ASV::HeadingAndSpeed::Arguments::rpm_ffgain, and Control::ASV::HeadingAndSpeed::Arguments::rpm_hardware.
|
inline |
Setup PIDs.
References Control::ASV::HeadingAndSpeed::Arguments::act_max, Control::ASV::HeadingAndSpeed::Arguments::log_parcels, Control::ASV::HeadingAndSpeed::Arguments::mps_gains, Control::ASV::HeadingAndSpeed::Arguments::mps_max_int, Control::ASV::HeadingAndSpeed::Arguments::rpm_gains, and Control::ASV::HeadingAndSpeed::Arguments::yaw_gains.
|
inline |
Distribute actuation references if over-saturated.
References Control::ASV::HeadingAndSpeed::Arguments::act_max, and Control::ASV::HeadingAndSpeed::Arguments::share.
|
inline |
Check if we are facing our waypoint to thrust.
[in] | yaw_err | yaw error. |
References Control::ASV::HeadingAndSpeed::Arguments::yaw_max.
IMC::SetThrusterActuation Control::ASV::HeadingAndSpeed::Task::m_act[2] |
Current motor actuation.
bool Control::ASV::HeadingAndSpeed::Task::m_common |
Apply common actuation.
Delta Control::ASV::HeadingAndSpeed::Task::m_delta |
Time of last estimated state message.
float Control::ASV::HeadingAndSpeed::Task::m_desired_speed |
Desired speed.
float Control::ASV::HeadingAndSpeed::Task::m_desired_yaw |
Desired heading.
IMC::SetThrusterActuation Control::ASV::HeadingAndSpeed::Task::m_last_act[2] |
Last motor actuation.
DiscretePID Control::ASV::HeadingAndSpeed::Task::m_mps_pid |
MPS PID controller.
IMC::ControlParcel Control::ASV::HeadingAndSpeed::Task::m_parcel_mps |
Control Parcels for meters per second controller.
IMC::ControlParcel Control::ASV::HeadingAndSpeed::Task::m_parcel_rpm |
Control Parcels for rpm controller.
IMC::ControlParcel Control::ASV::HeadingAndSpeed::Task::m_parcel_yaw |
Control Parcels for yaw controller.
float Control::ASV::HeadingAndSpeed::Task::m_previous_rpm |
previous value of the desired rpm speed
IMC::Rpm Control::ASV::HeadingAndSpeed::Task::m_rpm[2] |
Motor rpm.
uint16_t Control::ASV::HeadingAndSpeed::Task::m_rpm_eid[2] |
Motor rpm entity id.
DiscretePID Control::ASV::HeadingAndSpeed::Task::m_rpm_pid |
RPM PID controller.
uint32_t Control::ASV::HeadingAndSpeed::Task::m_scope_ref |
Control loops last reference.
uint8_t Control::ASV::HeadingAndSpeed::Task::m_speed_units |
Desired speed units.
DiscretePID Control::ASV::HeadingAndSpeed::Task::m_yaw_pid |
YAW PID controller.