Go to the documentation of this file.
1 #pragma once
3 #include <memory>
13 namespace drake {
14 namespace automotive {
26 // heading is defined around the +z axis, so positive-turn-left
51 template <typename T>
52 class SimpleCar final : public systems::LeafSystem<T> {
53  public:
56  SimpleCar();
59  template <typename U>
60  explicit SimpleCar(const SimpleCar<U>&);
62  // System<T> overrides
64  const systems::Context<T>& context,
65  systems::ContinuousState<T>* derivatives) const override;
67  const systems::OutputPort<T>& state_output() const;
68  const systems::OutputPort<T>& pose_output() const;
71  private:
72  void CalcStateOutput(const systems::Context<T>&, SimpleCarState<T>*) const;
73  void CalcPose(const systems::Context<T>&,
75  void CalcVelocity(const systems::Context<T>&,
78  void ImplCalcTimeDerivatives(const SimpleCarParams<T>& params,
79  const SimpleCarState<T>& state,
80  const DrivingCommand<T>& input,
81  SimpleCarState<T>* rates) const;
83  void CalcSteeringAngleConstraint(const systems::Context<T>&,
84  VectorX<T>*) const;
85  void CalcAccelerationConstraint(const systems::Context<T>&,
86  VectorX<T>*) const;
87  void CalcVelocityConstraint(const systems::Context<T>&, VectorX<T>*) const;
88 };
90 } // namespace automotive
91 } // namespace drake
void DoCalcTimeDerivatives(const systems::Context< T > &context, systems::ContinuousState< T > *derivatives) const override
Definition: simple_car.cc:146
Definition: automotive_demo.cc:88
Context is an abstract base class template that represents all the inputs to a System: time...
Definition: query_handle.h:10
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorX
A column vector of any size, templated on scalar type.
Definition: eigen_types.h:46
Definition: simple_car.cc:62
An OutputPort belongs to a System and represents the properties of one of that System&#39;s output ports...
Definition: output_port.h:67
Specializes BasicVector with specific getters and setters.
Definition: driving_command.h:37
A superclass template that extends System with some convenience utilities that are not applicable to ...
Definition: leaf_system.h:43
SimpleCar models an idealized response to driving commands, neglecting all physics.
Definition: simple_car.h:52
A 7-vector representing the transform of frame A in the world frame, X_WA, in the form {p_WA...
Definition: pose_vector.h:19
const systems::OutputPort< T > & state_output() const
Definition: simple_car.cc:85
const systems::OutputPort< T > & velocity_output() const
Definition: simple_car.cc:95
A 6-vector representing the derivatives of the position transform of frame A in the world frame...
Definition: frame_velocity.h:22
Specializes BasicVector with specific getters and setters.
Definition: simple_car_state.h:39
ContinuousState is a container for all the continuous state variables xc.
Definition: continuous_state.h:44
const systems::OutputPort< T > & pose_output() const
Definition: simple_car.cc:90
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN deletes the special member functions for copy-construction, copy-assignment, move-construction, and move-assignment.
Definition: drake_copyable.h:35
Specializes BasicVector with specific getters and setters.
Definition: simple_car_params.h:41
Provides careful macros to selectively enable or disable the special member functions for copy-constr...