Skip to content

Commit 2c9717a

Browse files
authored
Fix open_loop odometry of steering controllers (backport #2087) (#2088)
1 parent da13d7a commit 2c9717a

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
@@ -582,9 +582,13 @@ controller_interface::return_type SteeringControllersLibrary::update_reference_f
582582
controller_interface::return_type SteeringControllersLibrary::update_and_write_commands(
583583
const rclcpp::Time & time, const rclcpp::Duration & period)
584584
{
585-
update_odometry(period);
586585
auto logger = get_node()->get_logger();
587586

587+
// store current ref (for open loop odometry) and update odometry
588+
last_linear_velocity_ = reference_interfaces_[0];
589+
last_angular_velocity_ = reference_interfaces_[1];
590+
update_odometry(period);
591+
588592
// MOVE ROBOT
589593

590594
// Limit velocities and accelerations:

0 commit comments

Comments
 (0)