delphyne
SimpleCar2< T > Class Template Referencefinal

Detailed Description

template<typename T>
class delphyne::SimpleCar2< T >

SimpleCar models an idealized response to driving commands, neglecting all physics.

Note that SimpleCar can move forward, stop, turn left, and turn right but cannot travel in reverse.

parameters:

state vector (planar for now):

  • position: x, y, heading; heading is 0 rad when pointed +x, pi/2 rad when pointed +y;
  • velocity

input vector:

  • steering angle (virtual center wheel angle); a positive angle means a positive change in heading (left turn); the value must lie within (-pi, +pi).
  • throttle (0-1)
  • brake (0-1)

output port 0: same as state vector. output port 1: A PoseVector containing X_WC, where C is the car frame. output port 2: A FrameVelocity containing Xdot_WC, where C is the car frame.

Template Parameters
Tmust support certain arithmetic operations; for details, see drake::symbolic::Expression.

Instantiated templates for the following ScalarTypes are provided:

  • double
  • drake::AutoDiffXd
  • drake::symbolic::Expression

They are already available to link against in the containing library.

#include <src/systems/simple_car.h>

Inheritance diagram for SimpleCar2< T >:
[legend]

Public Member Functions

 SimpleCar2 (const SimpleCarState< T > &initial_context_state=SimpleCarState< T >(), const SimpleCarParams< T > &initial_context_parameters=SimpleCarParams< T >())
 Initialise the background context on construction. More...
 
template<typename U >
 SimpleCar2 (const SimpleCar2< U > &)
 Scalar-converting copy constructor. More...
 
void DoCalcTimeDerivatives (const drake::systems::Context< T > &context, drake::systems::ContinuousState< T > *derivatives) const override
 
const drake::systems::OutputPort< T > & state_output () const
 
const drake::systems::OutputPort< T > & pose_output () const
 
const drake::systems::OutputPort< T > & velocity_output () const
 

Constructor & Destructor Documentation

◆ SimpleCar2() [1/2]

SimpleCar2 ( const SimpleCarState< T > &  initial_context_state = SimpleCarState<T>(),
const SimpleCarParams< T > &  initial_context_parameters = SimpleCarParams<T>() 
)

Initialise the background context on construction.

The alternative is to back-fill these context values after the system has been added to a diagram and the subsystem context retrieved, but before execution.

Parameters
[in]initial_context_stateThe continuous state.
[in]initial_context_parametersThe numeric parameterization.

◆ SimpleCar2() [2/2]

SimpleCar2 ( const SimpleCar2< U > &  )
explicit

Scalar-converting copy constructor.

Member Function Documentation

◆ DoCalcTimeDerivatives()

void DoCalcTimeDerivatives ( const drake::systems::Context< T > &  context,
drake::systems::ContinuousState< T > *  derivatives 
) const
override

◆ pose_output()

const drake::systems::OutputPort< T > & pose_output

◆ state_output()

const drake::systems::OutputPort< T > & state_output

◆ velocity_output()

const drake::systems::OutputPort< T > & velocity_output

The documentation for this class was generated from the following files: