Drake
lane_direction.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 
6 
7 namespace drake {
8 namespace automotive {
9 
10 /// LaneDirection holds the lane that a MaliputRailcar is traversing and the
11 /// direction in which it is moving. A MaliputRailcar can either travel in the
12 /// increasing-`s` direction or in the decreasing-`s` direction.
13 struct LaneDirection {
15 
16  /// Default constructor.
18 
19  /// A constructor that sets `with_s` to be `true`.
20  explicit LaneDirection(const maliput::api::Lane* lane_input)
21  : LaneDirection(lane_input, true) {}
22 
23  /// Fully parameterized constructor.
24  LaneDirection(const maliput::api::Lane* lane_input, bool with_s_input)
25  : lane(lane_input), with_s(with_s_input) {}
26 
27  const maliput::api::Lane* lane{nullptr};
28 
29  /// True means that the MaliputRailcar's `s` coordinate increases when the
30  /// vehicle has positive speed. False means the opposite.
31  bool with_s{true};
32 };
33 
34 } // namespace automotive
35 } // namespace drake
LaneDirection(const maliput::api::Lane *lane_input, bool with_s_input)
Fully parameterized constructor.
Definition: lane_direction.h:24
Definition: automotive_demo.cc:88
bool with_s
True means that the MaliputRailcar&#39;s s coordinate increases when the vehicle has positive speed...
Definition: lane_direction.h:31
LaneDirection(const maliput::api::Lane *lane_input)
A constructor that sets with_s to be true.
Definition: lane_direction.h:20
A Lane represents a lane of travel in a road network.
Definition: lane.h:34
#define DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN(Classname)
DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN defaults the special member functions for copy-construction, copy-assignment, move-construction, and move-assignment.
Definition: drake_copyable.h:57
const maliput::api::Lane * lane
Definition: lane_direction.h:27
LaneDirection holds the lane that a MaliputRailcar is traversing and the direction in which it is mov...
Definition: lane_direction.h:13