Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
odometry_model.cpp
Go to the documentation of this file.
1
3
5
6Eigen::Vector3d OdometryModel::get_pose_difference(const Eigen::Vector3d &previous_pose,
7 const Eigen::VectorXd &motion_data,
8 [[maybe_unused]] const double delta_t) {
9 Eigen::Vector3d pose_difference;
10 pose_difference(0) = motion_data(0) - previous_pose(0);
11 pose_difference(1) = motion_data(1) - previous_pose(1);
12 pose_difference(2) = common_lib::maths::normalize_angle(motion_data(2) - previous_pose(2));
13 return pose_difference;
14}
15
17 [[maybe_unused]] const Eigen::Vector3d &previous_pose,
18 [[maybe_unused]] const Eigen::VectorXd &motion_data, [[maybe_unused]] const double delta_t) {
19 Eigen::Matrix3d jacobian = Eigen::Matrix3d::Identity();
20 return jacobian;
21}
22
24 [[maybe_unused]] const Eigen::Vector3d &previous_pose,
25 [[maybe_unused]] const Eigen::VectorXd &motion_data, [[maybe_unused]] const double delta_t) {
26 Eigen::MatrixXd jacobian = Eigen::MatrixXd::Zero(3, 4);
27 jacobian(0, 0) = 1.0;
28 jacobian(1, 1) = 1.0;
29 jacobian(2, 2) = 1.0;
30 return jacobian;
31}
Eigen::Vector3d get_pose_difference(const Eigen::Vector3d &previous_pose, const Eigen::VectorXd &motion_data, const double delta_t) override
Gives the increments to the pose instead of the next pose.
Eigen::Matrix3d get_jacobian_pose(const Eigen::Vector3d &previous_pose, const Eigen::VectorXd &motion_data, const double delta_t) override
Get the Jacobian matrix of the motion model in relation to motion_data (commands)
Eigen::MatrixXd get_jacobian_motion_data(const Eigen::Vector3d &previous_pose, const Eigen::VectorXd &motion_data, const double delta_t) override
Get the Jacobian matrix of the motion model in relation to motion data (commands)
double normalize_angle(double angle)
Function to keep angle in [-Pi, Pi[ radians.