forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroad_odometry.h
32 lines (27 loc) · 1.18 KB
/
road_odometry.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include "drake/automotive/maliput/api/lane.h"
#include "drake/automotive/maliput/api/lane_data.h"
#include "drake/systems/rendering/frame_velocity.h"
namespace drake {
namespace automotive {
/// RoadOdometry contains the position of the vehicle with respect to a lane in
/// a road, along with its velocity vector in the world frame.
template <typename T>
struct RoadOdometry {
/// Default constructor.
RoadOdometry() = default;
/// Fully-parameterized constructor.
RoadOdometry(const maliput::api::RoadPosition& road_position,
const systems::rendering::FrameVelocity<double>& frame_velocity)
: lane(road_position.lane), pos(road_position.pos), vel(frame_velocity) {}
/// Fully-parameterized constructor that is T-supported.
RoadOdometry(const maliput::api::Lane* lane_in,
const maliput::api::LanePositionT<T>& lane_position,
const systems::rendering::FrameVelocity<T>& frame_velocity)
: lane(lane_in), pos(lane_position), vel(frame_velocity) {}
const maliput::api::Lane* lane{};
maliput::api::LanePositionT<T> pos{};
systems::rendering::FrameVelocity<T> vel{};
};
} // namespace automotive
} // namespace drake