Drake
gyroscope.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 
15 
16 namespace drake {
17 namespace systems {
18 namespace sensors {
19 
57 class Gyroscope : public systems::LeafSystem<double> {
58  public:
60 
77  Gyroscope(const std::string& name, const RigidBodyFrame<double>& frame,
78  const RigidBodyTree<double>& tree);
79 
81  const RigidBodyTree<double>& get_tree() const { return tree_; }
82 
87  const RigidBodyFrame<double>& get_frame() const { return frame_; }
88 
93  return System<double>::get_input_port(input_port_index_);
94  }
95 
99  return System<double>::get_output_port(output_port_index_);
100  }
101 
102  private:
103  // Computes the angular velocity as sensed by this sensor.
104  void CalcAngularVelocity(const Context<double>& context,
105  GyroscopeOutput<double>* output_vector) const;
106 
107  const std::string name_;
108  const RigidBodyFrame<double> frame_;
109  const RigidBodyTree<double>& tree_;
110 
111  int input_port_index_{};
112  int output_port_index_{};
113 };
114 
115 } // namespace sensors
116 } // namespace systems
117 } // namespace drake
const RigidBodyFrame< double > & get_frame() const
Returns this sensor&#39;s frame, which specifies its location and orientation in the RigidBodyTree.
Definition: gyroscope.h:87
This file contains abbreviated definitions for certain specializations of Eigen::Matrix that are comm...
Definition: automotive_demo.cc:88
const InputPortDescriptor< double > & get_input_port() const
Returns a descriptor of the input port that should contain the generalized (i.e., linear and rotation...
Definition: gyroscope.h:92
const InputPortDescriptor< T > & get_input_port(int port_index) const
Returns the descriptor of the input port at index port_index.
Definition: system.h:815
A simulated ideal gyroscope.
Definition: gyroscope.h:57
const OutputPort< double > & get_output_port() const
Returns a the state output port, which contains the sensor&#39;s sensed values.
Definition: gyroscope.h:98
A superclass template that extends System with some convenience utilities that are not applicable to ...
Definition: leaf_system.h:82
Gyroscope(const Gyroscope &)=delete
Specializes BasicVector with accessors and setters that are useful for consumers of Gyroscope&#39;s outpu...
Definition: gyroscope_output.h:20
const OutputPort< T > & get_output_port(int port_index) const
Returns the output port at index port_index.
Definition: system.h:826
#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:35
const RigidBodyTree< double > & get_tree() const
Returns the RigidBodyTree that this sensor is sensing.
Definition: gyroscope.h:81
Provides careful macros to selectively enable or disable the special member functions for copy-constr...