Skip to content

Commit

Permalink
Reset initial value of last commanded time to 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl committed Sep 26, 2023
1 parent 79c6d1c commit be07b0a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ controller_interface::return_type JointTrajectoryController::update(
first_sample = true;
if (params_.open_loop_control)
{
traj_external_point_ptr_->set_point_before_trajectory_msg(time, last_commanded_state_);
if (last_commanded_time_.seconds() == 0.0)
{
last_commanded_time_ = time;
}
traj_external_point_ptr_->set_point_before_trajectory_msg(
last_commanded_time_, last_commanded_state_);
}
else
{
Expand Down Expand Up @@ -999,6 +1004,7 @@ controller_interface::CallbackReturn JointTrajectoryController::on_activate(
state_desired_ = state;
last_commanded_state_ = state;
}
last_commanded_time_ = rclcpp::Time();

// Should the controller start by holding position at the beginning of active state?
if (params_.start_with_holding)
Expand Down

0 comments on commit be07b0a

Please sign in to comment.