-
Notifications
You must be signed in to change notification settings - Fork 181
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
Sort-of rebase of 83: traj action aborts on error #271
base: melodic-devel
Are you sure you want to change the base?
Sort-of rebase of 83: traj action aborts on error #271
Conversation
I've requested @Levi-Armstrong and/or @JeremyZoss review this, as they've been involved with the development of @simonschmeisser: if you're still using this, and have some time, I'd appreciate your opinion as well. Note: I do not intent to keep developing all of this. I just wanted to make sure I can get #83 in before releasing a new version of Note 2: it's still possible for trajectory relays to keep moving after an e-stop or error state is cleared: there is no way for the ROS side here (so the IRC node) to enforce anything. The streamer will now in all cases send a "traj abort" message, but if the trajectory and state relays (running on the OEM controller) do not cooperate, there isn't much we can do.
|
This probably also addresses #131 partly, as this should not be possible any more (the JTA should reject the goal due to the controller not being in AUTO mode, or at least not reporting that
Of course it will depend on the (OEM) state program to properly report controller state (ie: |
The action server will now take (OEM) motion server state into account when accepting or executing goals. If the motion server reports (via the state server) it cannot currently execute motion, either because of a controller error or e-stop, or because a required program is not running on the (OEM) controller, new goals are rejected and currently executing goals are cancelled. Cancelled trajectories should not resume executing once the (OEM) controller error state is cleared. This will however depend on a cooperating motion server (ie: it must manage its queues properly and watch for and act on errors on the OEM controller). Cancellations and rejections are accompanied by appropriate human error messages, giving the reason for why a goal was cancelled or rejected. Unfortunately this is mostly only human readable as the FollowJointTrajectory action doesn't currently define appropriately expressive result codes.
To keep the behaviour of the action server bw-compatible with the previous behaviour, add two ROS parameters which allow to: - ignore motion server state completely - treat UNKNOWN motion server state as ON or OFF (where appropriate) By default motion server state is neither ignored nor are UNKNOWNs acceptable values (and so UNKNOWNs will result in rejected goals and aborted trajectory executions).
Instead of manually comparing against TriState enum values.
It doesn't need to be *this* verbose.
But keep previous behaviour.
So we can reuse stopping the relay.
8c77870
to
22e3a09
Compare
Friendly ping. I don't believe this needs extensive testing. The main question is whether we want to change the default behaviour (from not checking to checking). |
industrial_robot_client/include/industrial_robot_client/joint_trajectory_action.h
Outdated
Show resolved
Hide resolved
industrial_robot_client/include/industrial_robot_client/joint_trajectory_action.h
Outdated
Show resolved
Hide resolved
@@ -30,6 +30,9 @@ | |||
<node pkg="industrial_robot_client" type="motion_download_interface" name="motion_download_interface"/> | |||
|
|||
<!-- joint_trajectory_action: provides actionlib interface for high-level robot control --> | |||
<node pkg="industrial_robot_client" type="joint_trajectory_action" name="joint_trajectory_action"/> | |||
<node pkg="industrial_robot_client" type="joint_trajectory_action" name="joint_trajectory_action"> | |||
<param name="ignore_motion_server_error" type="bool" value="true" /> |
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.
<param name="ignore_motion_server_error" type="bool" value="true" /> | |
<param name="ignore_motion_server_error" type="bool" value="false" /> |
I really appreciate this being tunable but I think we should be strict by default as it can introduce surprising delayed movements if you later enable movements (maybe ... maybe not ... ?)
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.
So this is indeed the main point of discussion here.
Doing this by default has the potential to break ppl's setups.
We could merge this PR as-is and not enable it on Melodic, then branch for Noetic and enable it there by default.
I hate branching for these little things, but I don't really see another option.
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.
If we leave it disabled, how would you enable it manually? copy paste the launch file?
I totally agree on avoiding branch-mess where possible
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.
I see now that I forgot to export the param
s using arg
s. I'll add that. That would allow overriding the defaults.
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.
Seems I've forgotten to fix the arg
s missing. I'll need to address that before merging this.
industrial_robot_client/launch/robot_interface_streaming.launch
Outdated
Show resolved
Hide resolved
Co-authored-by: Simon Schmeisser <[email protected]>
Co-authored-by: Simon Schmeisser <[email protected]>
@simonschmeisser: thanks for the review. Would you see an opportunity to test this on any real hw? I'd be interested to know whether this mitigates what you reported in #131 for instance. |
I'll try to fit in testing that on our Mitsubishi in the evening |
I actually don't have access to an downloading driver / robot, so I'd be interested to know whether the proposed changes actually work there. If they do, we'll need to update the |
Thanks for pointing that out, I actually only have access to a downloading robot/driver |
I expect the changes to accepting goals to work for both. I believe that should help with #131. Aborting active goals will work, but whether the OEM server program also cooperates I can't say -- and will depend on its implementation of course. |
Follow the style of IRC.
isOn(..), isOff(..) and isUnknown(..) are a bit too generic to not isolate them a bit.
Instead of as part of the ctor.
We would need to set the I'm not sure why we have the empty controller name in all of our controller files ... what do you usually put there? Something like |
According to the api doc (and the sources), anything you pass to
It's most likely empty because the template in the tutorial lots of people refer to has it set to If you set it to something non-empty, MoveIt will start looking in a different place for your action topics. That's not necessarily a problem though, you'd just have to update your driver to offer the action server there (or |
But we have two text variables for the error here. The generic one you are setting and the redundant one in http://docs.ros.org/en/api/control_msgs/html/action/FollowJointTrajectory.html |
O, crap, you're right. I'd somehow confused those. Perhaps MoveIt should check both and display them. |
So with the technical side out of the way, the question becomes: do we want to merge this into @simonschmeisser @Levi-Armstrong @anyone-with-an-opinion-really? |
With 0eeb23f and 0fa8bba, MoveIt now reports something like:
The double controller there can be a bit confusing. I was thinking of maybe adding "OEM" or "robot" there, so we would get:
But this would of course not be accurate if the server side would not run on an OEM controller. |
I'm not sure how many people understand what you mean by |
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.
There don't seem to be that many opinionated people around any more ...
I vote for merging this as is to melodic-devel
as I see the slight change in behavior as a bug fix basically
So their values can be changed by users.
Ok, to move this forward, I'm going to create a "post noetic" branch. On that branch, everything discussed here will default to On both Melodic and Noetic, they'll default to People still using |
Friendly ping, could be part of ros-o |
Sort-of, as it's actually a bit more than what was included in #83.
The proposed changes make the
joint_trajectory_action
aware of the state of the (OEM) motion server program (as far as it publishes that in the form ofRobotStatus
messages). In two cases is this information taken into account:In both cases, the following is monitored / checked:
motion_possible
istrue
?If any of these are not as expected, the goal is rejected, or, if a goal is currently being processed (ie: motion is execution), the goal is aborted and trajectory execution cancelled (as that should now work, with #260 merged (which still requires a cooperating driver of course)).
In all cases, the action result would be
INVALID_GOAL
, as unfortunately theFollowJointTrajectory
action message does not define any really more suitable error codes.Also in all cases: the reason for aborting or rejecting a goal is described in a human readable message.
When rejecting goals:
When aborting goals:
(this is output from
fanuc_driver
:11003
is Deadman switch released, which will indeed prevent any motion in manual mode)While this is certainly not perfect (it doesn't address #265 nor #118), together with #263 and #260 and an (OEM) relay which behaves according to the spec, the UX of
industrial_robot_client
is improved quite a bit.Lastly: as previous versions of the JTA did not check anything, misbehaving drivers would still be able to execute motions, even if they didn't properly populate all fields of the
RobotStatus
messages. In order to still allow usage of such systems, two new parameters were added which can be used to revert the JTA back to its previous behaviour (ie: don't check anything, always forward goals to drivers).In the current implementation, the default is to disable these new checks. Something to discuss is whether we should make the default to enable the new checks, and users with misbehaving drivers should instead be required to explicitly enable the bw-compatible behaviour.