-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update robot state if time since last command exceeds timeout #3251
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this!
I'm wondering, how is this logic different from what is already in e.g.
moveit2/moveit_ros/moveit_servo/src/servo_node.cpp
Lines 213 to 229 in 2b9173b
const bool command_stale = (node_->now() - latest_joint_jog_.header.stamp) >= | |
rclcpp::Duration::from_seconds(servo_params_.incoming_command_timeout); | |
if (!command_stale) | |
{ | |
JointJogCommand command{ latest_joint_jog_.joint_names, latest_joint_jog_.velocities }; | |
next_joint_state = servo_->getNextJointState(robot_state, command); | |
} | |
else | |
{ | |
auto result = servo_->smoothHalt(last_commanded_state_); | |
new_joint_jog_msg_ = !result.first; | |
if (new_joint_jog_msg_) | |
{ | |
next_joint_state = result.second; | |
RCLCPP_DEBUG_STREAM(node_->get_logger(), "Joint jog command timed out. Halting to a stop."); | |
} | |
} |
Would you be able to instead fix the existing logic instead of adding new lines of code?
@sea-bass
Yes, I can. Is it correct to write the added code when command_stale in jog, twist and pose fuction is true? |
Exactly! It would also be appreciated if you could write a unit test for this logic, to verify the fixes. |
Description
When starting both move_group and moveit_servo simultaneously, controlling the arm with move_group first and then performing jog operations with moveit_servo resulted in the jog operations being executed from the arm's initial pose, without considering the results of the previous control.
To address this issue, the robot's state is now updated synchronously, halting other processes if no control commands are received for a duration exceeding the incoming_command_timeout, which indicates that no jog operations are being executed.
Checklist