Skip to content

Commit 441f2b2

Browse files
Fix open_loop odometry of steering controllers (#2087)
1 parent cd6823b commit 441f2b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

steering_controllers_library/src/steering_controllers_library.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,13 @@ controller_interface::return_type SteeringControllersLibrary::update_reference_f
517517
controller_interface::return_type SteeringControllersLibrary::update_and_write_commands(
518518
const rclcpp::Time & time, const rclcpp::Duration & period)
519519
{
520-
update_odometry(period);
521520
auto logger = get_node()->get_logger();
522521

522+
// store current ref (for open loop odometry) and update odometry
523+
last_linear_velocity_ = reference_interfaces_[0];
524+
last_angular_velocity_ = reference_interfaces_[1];
525+
update_odometry(period);
526+
523527
// MOVE ROBOT
524528

525529
// Limit velocities and accelerations:

0 commit comments

Comments
 (0)