Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ inline bool check_state_tolerance_per_joint(
if (show_errors)
{
const auto logger = rclcpp::get_logger("tolerances");
RCLCPP_ERROR(logger, "State tolerances failed for joint %d:", joint_idx);
RCLCPP_ERROR(logger, "State tolerances failed for joint %lu:", joint_idx);

if (state_tolerance.position > 0.0 && abs(error_position) > state_tolerance.position)
{
Expand Down
23 changes: 23 additions & 0 deletions joint_trajectory_controller/test/test_trajectory_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2104,3 +2104,26 @@ TEST_F(TrajectoryControllerTest, incorrect_initialization_using_interface_parame
state_interface_types_ = {"velocity"};
EXPECT_EQ(SetUpTrajectoryControllerLocal(), controller_interface::return_type::ERROR);
}

TEST_F(TrajectoryControllerTest, time_from_start_populated)
{
rclcpp::executors::SingleThreadedExecutor executor;
SetUpAndActivateTrajectoryController(executor, {});
subscribeToState(executor);

// schedule a single waypoint at 100ms:
builtin_interfaces::msg::Duration tfs;
tfs.sec = 0;
tfs.nanosec = 100000000;
publish(tfs, {INITIAL_POS_JOINTS}, rclcpp::Time(0));
traj_controller_->wait_for_trajectory(executor);

updateController();
// give the publish timer one more spin
executor.spin_some();

auto state = getState();
ASSERT_TRUE(state);
EXPECT_EQ(state->feedback.time_from_start.sec, 0u);
EXPECT_EQ(state->feedback.time_from_start.nanosec, 100000000u);
}
Loading