DUNE: Uniform Navigational Environment  2016.05.0
DUNE::Simulation::UAVSimulation Class Reference

Classes

class  Error
 

Public Member Functions

 UAVSimulation (Tasks::Task &task)
 
 UAVSimulation (const UAVSimulation &simul)
 
 UAVSimulation (Tasks::Task &task, const double &alt_time_cst)
 
 UAVSimulation (Tasks::Task &task, const double &bank_time_cst, const double &speed_time_cst)
 
 UAVSimulation (Tasks::Task &task, const double &bank_time_cst, const double &speed_time_cst, const double &alt_time_cst)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &vel)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &vel, const double &alt_time_cst)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &vel, const double &bank_time_cst, const double &speed_time_cst)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &vel, const double &bank_time_cst, const double &speed_time_cst, const double &alt_time_cst)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &vel, const double &bank_time_cst, const double &speed_time_cst, const double &airspeed_cmd, const double &bank_cmd)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &pos, const DUNE::Math::Matrix &vel)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &pos, const DUNE::Math::Matrix &vel, const double &alt_time_cst)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &pos, const DUNE::Math::Matrix &vel, const double &bank_time_cst, const double &speed_time_cst)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &pos, const DUNE::Math::Matrix &vel, const double &bank_time_cst, const double &speed_time_cst, const double &alt_time_cst)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &pos, const DUNE::Math::Matrix &vel, const double &bank_time_cst, const double &speed_time_cst, const double &airspeed_cmd, const double &bank_cmd)
 
 UAVSimulation (Tasks::Task &task, const DUNE::Math::Matrix &pos, const DUNE::Math::Matrix &vel, const double &bank_time_cst, const double &speed_time_cst, const double &alt_time_cst, const double &airspeed_cmd, const double &bank_cmd, const double &altitude_cmd)
 
UAVSimulationoperator= (const UAVSimulation &model)
 
void resetModel (void)
 
UAVSimulation update (const double &timestep)
 
UAVSimulation update (const double &timestep, const double &bank_cmd)
 
UAVSimulation update (const double &timestep, const double &bank_cmd, const double &airspeed_cmd)
 
UAVSimulation update (const double &timestep, const double &bank_cmd, const double &airspeed_cmd, const double &altitude_cmd)
 
void setCtrl (const double &bank_time_cst, const double &speed_time_cst)
 
void setCtrl (const double &bank_time_cst, const double &speed_time_cst, const double &alt_time_cst)
 
void setBankRateLim (const double &bank_rate_lim)
 
void setAccelLim (const double &lon_accel_lim)
 
void setVertSlopeLim (const double &vert_slope_lim)
 
DUNE::Math::Matrix getPosition (void)
 
DUNE::Math::Matrix getVelocity (void)
 
double getAirspeed (void)
 
double getBankCmd (void)
 
double getAirspeedCmd (void)
 
double getAltCmd (void)
 
void setPosition (const DUNE::Math::Matrix &pos)
 
void setVelocity (const DUNE::Math::Matrix &vel)
 
void command (const double &bank_cmd)
 
void command (const double &bank_cmd, const double &airspeed_cmd)
 
void command (const double &bank_cmd, const double &airspeed_cmd, const double &altitude_cmd)
 
void commandBank (const double &bank_cmd)
 
void commandAirspeed (const double &airspeed_cmd)
 
void commandAlt (const double &altitude_cmd)
 
void commandFPA (const double &fpa_cmd)
 
void commandPitch (const double &pitch_cmd)
 

Public Attributes

Tasks::Taskm_task
 
std::string m_sim_type
 
DUNE::Math::Matrix m_wind
 
double m_g
 
double m_timestep_lim
 

Constructor & Destructor Documentation

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task)

Constructor.

Create a simulation model with null initial state. 3 DOF simulation.

Parameters
[in]task- filter parent task.

References resetModel().

DUNE::Simulation::UAVSimulation::UAVSimulation ( const UAVSimulation simul)

Constructor.

Create a simulation model as a copy of another

Parameters
[in]simul- simulation model to be replicated
DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const double &  alt_time_cst 
)

Constructor.

Create a simulation model with null initial state and the vehicle model parameters. 4 DOF simulation with altitude dynamics.

Parameters
[in]task- filter parent task.
[in]alt_time_cst- altitude time constant

References resetModel().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const double &  bank_time_cst,
const double &  speed_time_cst 
)

Constructor.

Create a simulation model with null initial state and the vehicle model parameters. 4 DOF simulation with bank and speed dynamics.

Parameters
[in]task- filter parent task.
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant

References resetModel().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const double &  bank_time_cst,
const double &  speed_time_cst,
const double &  alt_time_cst 
)

Constructor.

Create a simulation model with null initial state and the vehicle model parameters. 5 DOF simulation with bank, speed, and altitude dynamics.

Parameters
[in]task- filter parent task.
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant
[in]alt_time_cst- altitude time constant

References resetModel().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix vel 
)

Constructor.

Create a simulation model based on the initial velocity state. 3 DOF simulation.

Parameters
[in]task- filter parent task.
[in]vel- initial velocity vector

References resetModel(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix vel,
const double &  alt_time_cst 
)

Constructor.

Create a simulation model based on the initial velocity state and the vehicle model parameters. 4 DOF simulation with altitude dynamics.

Parameters
[in]task- filter parent task.
[in]vel- initial velocity vector
[in]alt_time_cst- altitude time constant

References resetModel(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix vel,
const double &  bank_time_cst,
const double &  speed_time_cst 
)

Constructor.

Create a simulation model based on the initial velocity state and the vehicle model parameters. 4 DOF simulation with bank and speed dynamics.

Parameters
[in]task- filter parent task.
[in]vel- initial velocity vector
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant

References resetModel(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix vel,
const double &  bank_time_cst,
const double &  speed_time_cst,
const double &  alt_time_cst 
)

Constructor.

Create a simulation model based on the initial velocity state and the vehicle model parameters. 5 DOF simulation with bank, speed, and altitude dynamics.

Parameters
[in]task- filter parent task.
[in]vel- initial velocity vector
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant
[in]alt_time_cst- altitude time constant

References resetModel(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix vel,
const double &  bank_time_cst,
const double &  speed_time_cst,
const double &  airspeed_cmd,
const double &  bank_cmd 
)

Constructor.

Create a simulation model based on the initial velocity state, the vehicle model parameters, and initial commands. 4 DOF simulation with bank and speed dynamics.

Parameters
[in]task- filter parent task.
[in]vel- initial velocity vector
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant
[in]airspeed_cmd- applied airspeed command
[in]bank_cmd- applied bank command

References commandAirspeed(), commandBank(), resetModel(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix pos,
const DUNE::Math::Matrix vel 
)

Constructor.

Create a simulation model based on the initial state. 3 DOF simulation.

Parameters
[in]task- filter parent task.
[in]pos- initial position vector
[in]vel- initial velocity vector

References resetModel(), setPosition(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix pos,
const DUNE::Math::Matrix vel,
const double &  alt_time_cst 
)

Constructor.

Create a simulation model based on the initial state and the vehicle model parameters. 4 DOF simulation with altitude dynamics.

Parameters
[in]task- filter parent task.
[in]pos- initial position vector
[in]vel- initial velocity vector
[in]alt_time_cst- altitude time constant

References resetModel(), setPosition(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix pos,
const DUNE::Math::Matrix vel,
const double &  bank_time_cst,
const double &  speed_time_cst 
)

Constructor.

Create a simulation model based on the initial state and the vehicle model parameters. 4 DOF simulation with bank and speed dynamics.

Parameters
[in]task- filter parent task.
[in]pos- initial position vector
[in]vel- initial velocity vector
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant

References resetModel(), setPosition(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix pos,
const DUNE::Math::Matrix vel,
const double &  bank_time_cst,
const double &  speed_time_cst,
const double &  alt_time_cst 
)

Constructor.

Create a simulation model based on the initial state and the vehicle model parameters. 5 DOF simulation with bank, speed, and altitude dynamics.

Parameters
[in]task- filter parent task.
[in]pos- initial position vector
[in]vel- initial velocity vector
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant
[in]alt_time_cst- altitude time constant

References resetModel(), setPosition(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix pos,
const DUNE::Math::Matrix vel,
const double &  bank_time_cst,
const double &  speed_time_cst,
const double &  airspeed_cmd,
const double &  bank_cmd 
)

Constructor.

Create a simulation model based on the initial state, the vehicle model parameters, and initial commands. 4 DOF simulation with bank and speed dynamics.

Parameters
[in]task- filter parent task.
[in]pos- initial position vector
[in]vel- initial velocity vector
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant
[in]airspeed_cmd- applied airspeed command
[in]bank_cmd- applied bank command

References commandAirspeed(), commandBank(), resetModel(), setPosition(), and setVelocity().

DUNE::Simulation::UAVSimulation::UAVSimulation ( Tasks::Task task,
const DUNE::Math::Matrix pos,
const DUNE::Math::Matrix vel,
const double &  bank_time_cst,
const double &  speed_time_cst,
const double &  alt_time_cst,
const double &  airspeed_cmd,
const double &  bank_cmd,
const double &  altitude_cmd 
)

Constructor.

Create a simulation model based on the initial state, the vehicle model parameters, and initial commands. 5 DOF simulation with bank, speed, and altitude dynamics.

Parameters
[in]task- filter parent task.
[in]pos- initial position vector
[in]vel- initial velocity vector
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant
[in]alt_time_cst- altitude time constant
[in]airspeed_cmd- applied airspeed command
[in]bank_cmd- applied bank command
[in]altitude_cmd- applied altitude command

References commandAirspeed(), commandAlt(), commandBank(), resetModel(), setPosition(), and setVelocity().

Member Function Documentation

void DUNE::Simulation::UAVSimulation::command ( const double &  bank_cmd)

This method sets the vehicle control commands.

Parameters
[in]bank_cmd- applied bank command

References commandBank().

Referenced by Simulators::UAV::Task::onResourceAcquisition(), Maneuver::VehicleFormation::Coordinator::Task::onUpdateParameters(), and Maneuver::VehicleFormation::FormCollAvoid::Task::onUpdateParameters().

void DUNE::Simulation::UAVSimulation::command ( const double &  bank_cmd,
const double &  airspeed_cmd 
)

This method sets the vehicle control commands.

Parameters
[in]bank_cmd- applied bank command
[in]airspeed_cmd- applied airspeed command

References commandAirspeed(), and commandBank().

void DUNE::Simulation::UAVSimulation::command ( const double &  bank_cmd,
const double &  airspeed_cmd,
const double &  altitude_cmd 
)

This method sets the vehicle control commands.

Parameters
[in]bank_cmd- applied bank command
[in]airspeed_cmd- applied airspeed command
[in]altitude_cmd- applied altitude command

References commandAirspeed(), commandAlt(), and commandBank().

void DUNE::Simulation::UAVSimulation::commandAirspeed ( const double &  airspeed_cmd)

This method sets the vehicle airspeed command.

Parameters
[in]airspeed_cmd- applied airspeed command

References DUNE::Math::isNaN(), m_task, and DUNE::Tasks::Task::war().

Referenced by command(), Simulators::UAV::Task::consume(), Maneuver::VehicleFormation::Coordinator::Task::consume(), Maneuver::VehicleFormation::FormCollAvoid::Task::consume(), UAVSimulation(), and update().

void DUNE::Simulation::UAVSimulation::commandAlt ( const double &  altitude_cmd)
void DUNE::Simulation::UAVSimulation::commandBank ( const double &  bank_cmd)
void DUNE::Simulation::UAVSimulation::commandFPA ( const double &  fpa_cmd)

This method sets the vehicle flight path angle command.

Parameters
[in]fpa_cmd- applied flight path angle command

References DUNE::Math::isNaN(), m_task, and DUNE::Tasks::Task::war().

Referenced by Simulators::UAV::Task::consume().

void DUNE::Simulation::UAVSimulation::commandPitch ( const double &  pitch_cmd)

This method sets the vehicle pitch command.

Parameters
[in]pitch_cmd- applied pitch command

References DUNE::Math::isNaN(), m_task, and DUNE::Tasks::Task::war().

double DUNE::Simulation::UAVSimulation::getAirspeed ( void  )

This method gets the vehicle state.

Returns
airspeed - current aircraft total airspeed

Referenced by Maneuver::VehicleFormation::FormCollAvoid::Task::leaderOutput(), and Maneuver::VehicleFormation::Coordinator::Task::periodicUpdate().

double DUNE::Simulation::UAVSimulation::getAirspeedCmd ( void  )

This method gets the vehicle airspeed command.

Returns
airspeed command
double DUNE::Simulation::UAVSimulation::getAltCmd ( void  )

This method gets the vehicle altitude command.

Returns
altitude command
double DUNE::Simulation::UAVSimulation::getBankCmd ( void  )

This method gets the vehicle bank command.

Returns
bank command

Referenced by Maneuver::VehicleFormation::FormCollAvoid::Task::consume().

UAVSimulation & DUNE::Simulation::UAVSimulation::operator= ( const UAVSimulation model)

This method assigns a UAVSimulation with another UAVSimulation.

Parameters
[in]modelreference to UAV simulation model to be assigned
Returns
reference to resultant UAV simulation model

References m_g, m_sim_type, m_timestep_lim, and m_wind.

void DUNE::Simulation::UAVSimulation::resetModel ( void  )

This method resets all the vehicle model variables.

References m_g, m_timestep_lim, m_wind, and DUNE::Math::Matrix.

Referenced by UAVSimulation().

void DUNE::Simulation::UAVSimulation::setAccelLim ( const double &  lon_accel_lim)

This method sets the vehicle model longitudinal acceleration operation constraint.

Parameters
[in]lon_accel_lim- longitudinal acceleration limit

Referenced by Simulators::UAV::Task::onResourceAcquisition(), Maneuver::VehicleFormation::Coordinator::Task::onUpdateParameters(), and Maneuver::VehicleFormation::FormCollAvoid::Task::onUpdateParameters().

void DUNE::Simulation::UAVSimulation::setBankRateLim ( const double &  bank_rate_lim)

This method sets the vehicle model bank rate operation constraint.

Parameters
[in]bank_rate_lim- bank rate limit

Referenced by Simulators::UAV::Task::onResourceAcquisition(), Maneuver::VehicleFormation::Coordinator::Task::onUpdateParameters(), and Maneuver::VehicleFormation::FormCollAvoid::Task::onUpdateParameters().

void DUNE::Simulation::UAVSimulation::setCtrl ( const double &  bank_time_cst,
const double &  speed_time_cst 
)

This method sets the vehicle model control parameters.

Parameters
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant

Referenced by Maneuver::VehicleFormation::Coordinator::Task::onUpdateParameters(), and Maneuver::VehicleFormation::FormCollAvoid::Task::onUpdateParameters().

void DUNE::Simulation::UAVSimulation::setCtrl ( const double &  bank_time_cst,
const double &  speed_time_cst,
const double &  alt_time_cst 
)

This method sets the vehicle model control parameters.

Parameters
[in]bank_time_cst- bank angle time constant
[in]speed_time_cst- airspeed time constant
[in]alt_time_cst- altitude time constant
void DUNE::Simulation::UAVSimulation::setPosition ( const DUNE::Math::Matrix pos)
void DUNE::Simulation::UAVSimulation::setVelocity ( const DUNE::Math::Matrix vel)
void DUNE::Simulation::UAVSimulation::setVertSlopeLim ( const double &  vert_slope_lim)

This method sets the vehicle model vertical slope operation constraint.

Parameters
[in]vert_slope_lim- vertical slope limit

Referenced by Simulators::UAV::Task::onResourceAcquisition().

UAVSimulation DUNE::Simulation::UAVSimulation::update ( const double &  timestep)

This method updates the simulated state with the defined time step.

Parameters
[in]timestep- time step for the update
Returns
the updated state

References m_sim_type, m_task, m_timestep_lim, and DUNE::Tasks::Task::war().

Referenced by Maneuver::VehicleFormation::Coordinator::Task::periodicUpdate(), Simulators::UAV::Task::task(), Maneuver::VehicleFormation::FormCollAvoid::Task::teamPeriodicUpdate(), Maneuver::VehicleFormation::FormCollAvoid::Task::teamUnevenUpdate(), and update().

UAVSimulation DUNE::Simulation::UAVSimulation::update ( const double &  timestep,
const double &  bank_cmd 
)

This method updates the simulated state with the defined time step and controls.

Parameters
[in]timestep- time step for the update
[in]bank_cmd- applied bank command
Returns
the updated state

References commandBank(), and update().

UAVSimulation DUNE::Simulation::UAVSimulation::update ( const double &  timestep,
const double &  bank_cmd,
const double &  airspeed_cmd 
)

This method updates the simulated state with the defined time step and controls.

Parameters
[in]timestep- time step for the update
[in]bank_cmd- applied bank command
[in]airspeed_cmd- applied airspeed command
Returns
the updated state

References commandAirspeed(), commandBank(), and update().

UAVSimulation DUNE::Simulation::UAVSimulation::update ( const double &  timestep,
const double &  bank_cmd,
const double &  airspeed_cmd,
const double &  altitude_cmd 
)

This method updates the simulated state with the defined time step and controls.

Parameters
[in]timestep- time step for the update
[in]bank_cmd- applied bank command
[in]airspeed_cmd- applied airspeed command
[in]altitude_cmd- applied altitude command
Returns
the updated state

References commandAirspeed(), commandAlt(), commandBank(), and update().

Member Data Documentation

double DUNE::Simulation::UAVSimulation::m_g

Gravity acceleration.

Referenced by operator=(), and resetModel().

Tasks::Task& DUNE::Simulation::UAVSimulation::m_task
double DUNE::Simulation::UAVSimulation::m_timestep_lim

Time step control.

  • If negative, the time step limitation is disabled

Referenced by operator=(), resetModel(), and update().

Collaboration diagram for DUNE::Simulation::UAVSimulation:
Collaboration graph