Drake
traffic_light.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 
5 #include <Eigen/Geometry>
6 
10 
11 namespace drake {
12 namespace automotive {
13 
22 // TODO(nikos-tri): Support AutoDiffXd and Symbolic.
23 
24 template <typename T>
25 class TrafficLight : public systems::LeafSystem<T> {
26  public:
28 
29 
30  TrafficLight(T x_position, T y_position, T radius, T period);
31 
33  const systems::OutputPort<T>& output() const;
34 
35  private:
36  void DoCalcOutput(const systems::Context<T>& context,
37  systems::BasicVector<T>* output) const;
38 
39  // Indices for input / output ports.
40  const int traffic_input_index_{};
41  const int output_index_{};
42  int parameters_index_{};
43 
44  const VectorX<T> ReadParameters(const systems::Context<T>& context) const;
45  void WriteOutput(const VectorX<T> value,
46  systems::BasicVector<T>* output) const;
47 };
48 
49 } // namespace automotive
50 } // namespace drake
This file contains abbreviated definitions for certain specializations of Eigen::Matrix that are comm...
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
TrafficLight(const TrafficLight &)=delete
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorX
A column vector of any size, templated on scalar type.
Definition: eigen_types.h:46
const systems::OutputPort< T > & output() const
No input port, because this system is time-triggered.
Definition: traffic_light.cc:25
An OutputPort belongs to a System and represents the properties of one of that System&#39;s output ports...
Definition: output_port.h:67
This class is a first-pass model of a traffic light.
Definition: traffic_light.h:25
int value
Definition: copyable_unique_ptr_test.cc:61
A superclass template that extends System with some convenience utilities that are not applicable to ...
Definition: leaf_system.h:82
BasicVector is a semantics-free wrapper around an Eigen vector that satisfies VectorBase.
Definition: basic_vector.h:25
#define DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(Classname)
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:33
Provides careful macros to selectively enable or disable the special member functions for copy-constr...