Open
Conversation
372f2b8 to
c1d00f0
Compare
c1d00f0 to
c535c9b
Compare
bgill92
requested changes
May 5, 2025
| goal.goal_time_tolerance = rclcpp::Duration::from_seconds(time_tolerance); | ||
|
|
||
| // Send goal with feedback callback | ||
| typename rclcpp_action::Client<FollowJointTrajectory>::SendGoalOptions options; |
There was a problem hiding this comment.
Why is this typename? That shouldn't be needed.
| } | ||
| catch (const rclcpp_action::exceptions::UnknownGoalHandleError& e) | ||
| { | ||
| RCLCPP_WARN(rclcpp::get_logger("ExecuteAndTrackJointTrajectory"), "Failed to cancel goal: %s", e.what()); |
There was a problem hiding this comment.
This should probably be an error if we can't pause the joint trajectory?
| const std::shared_ptr<const FollowJointTrajectory::Feedback> feedback) | ||
| { | ||
| last_feedback_time_ = feedback->desired.time_from_start.sec + feedback->desired.time_from_start.nanosec * 1e-9; | ||
| setOutput<double>("time_from_start", last_feedback_time_); |
There was a problem hiding this comment.
Do we have to set time_from_start every time the feedback is processed or only when the trajectory is paused?
Comment on lines
+204
to
+224
| for (; start_index < full_trajectory_.points.size(); ++start_index) | ||
| { | ||
| double t = full_trajectory_.points[start_index].time_from_start.sec + | ||
| full_trajectory_.points[start_index].time_from_start.nanosec * 1e-9; | ||
| if (t >= last_feedback_time_) | ||
| break; | ||
| } | ||
| if (start_index >= full_trajectory_.points.size()) | ||
| return new_traj; | ||
|
|
||
| double offset = full_trajectory_.points[start_index].time_from_start.sec + | ||
| full_trajectory_.points[start_index].time_from_start.nanosec * 1e-9; | ||
| for (size_t i = start_index; i < full_trajectory_.points.size(); ++i) | ||
| { | ||
| auto pt = full_trajectory_.points[i]; | ||
| double orig = pt.time_from_start.sec + pt.time_from_start.nanosec * 1e-9; | ||
| double adjusted = orig - offset; | ||
| pt.time_from_start.sec = static_cast<uint32_t>(adjusted); | ||
| pt.time_from_start.nanosec = static_cast<uint32_t>((adjusted - pt.time_from_start.sec) * 1e9); | ||
| new_traj.points.push_back(pt); | ||
| } |
There was a problem hiding this comment.
Some additional here would make this could easier to grok.
Member
|
Can we get this month old PR merged in? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use this objective to test in lab_sim:
And call
ros2 service call /pause_trajectory std_srvs/srv/Triggerduring playback (see video)screencap-2025-05-05_07.12.04.mp4