DUNE: Uniform Navigational Environment
2017.01.0
|
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, m_args, m_desired_speed, m_speed_units, 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 |
References reset().
|
inline |
|
inline |
References m_desired_yaw.
|
inline |
References m_desired_speed, and m_speed_units.
|
inline |
References m_scope_ref, and reset().
|
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, m_act, m_args, m_last_act, and DUNE::Math::trimValue().
Referenced by consume().
|
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 m_args, m_desired_speed, m_mps_pid, m_parcel_mps, m_previous_rpm, 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.
Referenced by consume().
|
inline |
On activation.
|
inline |
On deactivation.
|
inline |
Reserve entities.
References Control::ASV::HeadingAndSpeed::Arguments::log_parcels, m_args, m_parcel_mps, m_parcel_rpm, and m_parcel_yaw.
|
inline |
Resolve entities.
References Control::ASV::HeadingAndSpeed::Arguments::eid_port, Control::ASV::HeadingAndSpeed::Arguments::eid_starboard, m_args, and m_rpm_eid.
|
inline |
|
inline |
References reset().
|
inline |
References Control::ASV::HeadingAndSpeed::Arguments::log_parcels, m_args, Control::ASV::HeadingAndSpeed::Arguments::mps_ffgain, Control::ASV::HeadingAndSpeed::Arguments::mps_gains, Control::ASV::HeadingAndSpeed::Arguments::mps_max_int, reset(), Control::ASV::HeadingAndSpeed::Arguments::rpm_ffgain, Control::ASV::HeadingAndSpeed::Arguments::rpm_gains, setup(), Control::ASV::HeadingAndSpeed::Arguments::yaw_gains, and Control::ASV::HeadingAndSpeed::Arguments::yaw_max.
|
inline |
Reset PIDs and actuation references.
References m_act, m_last_act, m_mps_pid, m_previous_rpm, m_rpm_pid, and m_yaw_pid.
Referenced by consume(), onResourceInitialization(), and onUpdateParameters().
|
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 m_args, m_parcel_rpm, m_rpm_pid, Control::ASV::HeadingAndSpeed::Arguments::rpm_eos, Control::ASV::HeadingAndSpeed::Arguments::rpm_ffgain, and Control::ASV::HeadingAndSpeed::Arguments::rpm_hardware.
Referenced by consume().
|
inline |
Setup PIDs.
References Control::ASV::HeadingAndSpeed::Arguments::act_max, Control::ASV::HeadingAndSpeed::Arguments::log_parcels, m_args, m_mps_pid, m_parcel_mps, m_parcel_rpm, m_parcel_yaw, m_rpm_pid, m_yaw_pid, 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.
Referenced by onUpdateParameters().
|
inline |
Distribute actuation references if over-saturated.
References Control::ASV::HeadingAndSpeed::Arguments::act_max, m_act, m_args, and Control::ASV::HeadingAndSpeed::Arguments::share.
Referenced by consume().
|
inline |
Check if we are facing our waypoint to thrust.
[in] | yaw_err | yaw error. |
References m_args, m_common, and Control::ASV::HeadingAndSpeed::Arguments::yaw_max.
Referenced by consume().
IMC::SetThrusterActuation Control::ASV::HeadingAndSpeed::Task::m_act[2] |
Current motor actuation.
Referenced by consume(), dispatchThrust(), reset(), and shareSaturation().
Arguments Control::ASV::HeadingAndSpeed::Task::m_args |
Task arguments.
Referenced by consume(), dispatchThrust(), mpsToRpm(), onEntityReservation(), onEntityResolution(), onUpdateParameters(), rpmToThrust(), setup(), shareSaturation(), Task(), and thrustForward().
bool Control::ASV::HeadingAndSpeed::Task::m_common |
Apply common actuation.
Referenced by thrustForward().
Delta Control::ASV::HeadingAndSpeed::Task::m_delta |
Time of last estimated state message.
Referenced by consume().
float Control::ASV::HeadingAndSpeed::Task::m_desired_speed |
Desired speed.
Referenced by consume(), mpsToRpm(), and Task().
float Control::ASV::HeadingAndSpeed::Task::m_desired_yaw |
Desired heading.
Referenced by consume().
IMC::SetThrusterActuation Control::ASV::HeadingAndSpeed::Task::m_last_act[2] |
Last motor actuation.
Referenced by dispatchThrust(), and reset().
DiscretePID Control::ASV::HeadingAndSpeed::Task::m_mps_pid |
MPS PID controller.
Referenced by mpsToRpm(), reset(), and setup().
IMC::ControlParcel Control::ASV::HeadingAndSpeed::Task::m_parcel_mps |
Control Parcels for meters per second controller.
Referenced by mpsToRpm(), onEntityReservation(), and setup().
IMC::ControlParcel Control::ASV::HeadingAndSpeed::Task::m_parcel_rpm |
Control Parcels for rpm controller.
Referenced by onEntityReservation(), rpmToThrust(), and setup().
IMC::ControlParcel Control::ASV::HeadingAndSpeed::Task::m_parcel_yaw |
Control Parcels for yaw controller.
Referenced by onEntityReservation(), and setup().
float Control::ASV::HeadingAndSpeed::Task::m_previous_rpm |
previous value of the desired rpm speed
Referenced by consume(), mpsToRpm(), and reset().
IMC::Rpm Control::ASV::HeadingAndSpeed::Task::m_rpm[2] |
Motor rpm.
Referenced by consume().
uint16_t Control::ASV::HeadingAndSpeed::Task::m_rpm_eid[2] |
Motor rpm entity id.
Referenced by consume(), and onEntityResolution().
DiscretePID Control::ASV::HeadingAndSpeed::Task::m_rpm_pid |
RPM PID controller.
Referenced by reset(), rpmToThrust(), and setup().
uint32_t Control::ASV::HeadingAndSpeed::Task::m_scope_ref |
uint8_t Control::ASV::HeadingAndSpeed::Task::m_speed_units |
DiscretePID Control::ASV::HeadingAndSpeed::Task::m_yaw_pid |