bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
diff_drive_odometry.h
Go to the documentation of this file.
1#ifndef BITSIM_ESTIMATION_DIFF_DRIVE_ODOMETRY_H
2#define BITSIM_ESTIMATION_DIFF_DRIVE_ODOMETRY_H
3
5
6namespace bitsim
7{
8namespace estimation
9{
10
38{
39 public:
44 struct Pose
45 {
46 real_t x{0.0};
47 real_t y{0.0};
48 real_t yaw{0.0};
49 };
50
56
60 void reset(const Pose &pose, real_t left_angle, real_t right_angle);
61
68 const Pose &update(real_t left_angle, real_t right_angle);
69
77 const Pose &update(real_t left_angle, real_t right_angle, real_t heading);
78
79 const Pose &pose() const noexcept { return pose_; }
80
85 real_t distance() const noexcept { return distance_; }
86
87 real_t wheel_radius() const noexcept { return wheel_radius_; }
88 real_t axle_length() const noexcept { return axle_length_; }
89
90 private:
91 real_t step_(real_t left_angle, real_t right_angle, real_t &turned);
92
93 real_t wheel_radius_;
94 real_t axle_length_;
95 Pose pose_;
96 real_t left_{0.0};
97 real_t right_{0.0};
98 real_t distance_{0.0};
99};
100
101} // namespace estimation
102} // namespace bitsim
103
104#endif // BITSIM_ESTIMATION_DIFF_DRIVE_ODOMETRY_H
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
const Pose & update(real_t left_angle, real_t right_angle)
Move the pose by what the wheels turned since the last update, heading included.
Definition diff_drive_odometry.cpp:42
const Pose & pose() const noexcept
Definition diff_drive_odometry.h:79
real_t wheel_radius() const noexcept
Definition diff_drive_odometry.h:87
real_t axle_length() const noexcept
Definition diff_drive_odometry.h:88
DiffDriveOdometry(real_t wheel_radius, real_t axle_length)
Definition diff_drive_odometry.cpp:12
real_t distance() const noexcept
Definition diff_drive_odometry.h:85
void reset(const Pose &pose, real_t left_angle, real_t right_angle)
Start from a pose, with the wheels at the given angles [rad].
Definition diff_drive_odometry.cpp:21
Definition diff_drive_ekf.cpp:12
Definition dc_motor_backend_base.h:9
double real_t
real_t
Definition bitsim_types.h:20
A pose in the plane: the point halfway between the wheels and the heading from the x axis [m,...
Definition diff_drive_odometry.h:45
real_t yaw
Definition diff_drive_odometry.h:48
real_t x
Definition diff_drive_odometry.h:46
real_t y
Definition diff_drive_odometry.h:47