File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ controller_interface::return_type PassthroughTrajectoryController::update(const
190190 if (current_transfer_state != TRANSFER_STATE_IDLE) {
191191 // Check if the trajectory has been aborted from the hardware interface. E.g. the robot was stopped on the teach
192192 // pendant.
193- if (command_interfaces_[PASSTHROUGH_TRAJECTORY_ABORT].get_value () == 1.0 ) {
193+ if (command_interfaces_[PASSTHROUGH_TRAJECTORY_ABORT].get_value () == 1.0 && current_index_ > 0 ) {
194194 RCLCPP_INFO (get_node ()->get_logger (), " Trajectory aborted hardware, aborting action." );
195195 std::shared_ptr<control_msgs::action::FollowJointTrajectory::Result> result =
196196 std::make_shared<control_msgs::action::FollowJointTrajectory::Result>();
@@ -278,7 +278,8 @@ controller_interface::return_type PassthroughTrajectoryController::update(const
278278 result->error_code = control_msgs::action::FollowJointTrajectory::Result::SUCCESSFUL;
279279 active_goal->setSucceeded (result);
280280 end_goal ();
281- RCLCPP_INFO (get_node ()->get_logger (), " Trajectory executed successfully!" );
281+ RCLCPP_INFO (get_node ()->get_logger (), " Trajectory executed successfully in %f seconds!" ,
282+ active_trajectory_elapsed_time_.seconds ());
282283 }
283284 } else if (current_transfer_state == TRANSFER_STATE_IN_MOTION) {
284285 // Keep track of how long the trajectory has been executing, if it takes too long, send a warning.
Original file line number Diff line number Diff line change @@ -933,6 +933,7 @@ hardware_interface::return_type URPositionHardwareInterface::perform_command_mod
933933 velocity_controller_running_ = false ;
934934 position_controller_running_ = false ;
935935 passthrough_trajectory_controller_running_ = true ;
936+ passthrough_trajectory_abort_ = 0.0 ;
936937 }
937938
938939 start_modes_.clear ();
@@ -947,6 +948,7 @@ void URPositionHardwareInterface::check_passthrough_trajectory_controller()
947948 /* See passthrough_trajectory_controller.hpp for an explanation of the passthrough_trajectory_transfer_state_ values.
948949 */
949950 if (passthrough_trajectory_transfer_state_ == 2.0 ) {
951+ passthrough_trajectory_abort_ = 0.0 ;
950952 trajectory_joint_positions_.push_back (passthrough_trajectory_positions_);
951953
952954 trajectory_times_.push_back (passthrough_trajectory_time_from_start_ - last_time);
You can’t perform that action at this time.
0 commit comments