-
Notifications
You must be signed in to change notification settings - Fork 24
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
Improve joy telep support #131
Conversation
a4cb2bb
to
e87bfbc
Compare
…ut the HCI RSSI feedback latches when the controller goes out of range, so it's useless as a metric.
…as a more predictable range of values
…the quality is low. Remove the (unused) launch file from the cutoff package. Update topic remappings in the teleop launch file
4866cb5
to
f4e2942
Compare
…h the l/r analogue triggers being 2 & 5. Update omni control configurations accordingly
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.
Other than the hidden topics, LGTM
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.
A couple more high level comments:
- Consider adding some additional info logging lines to show if it is still waiting on something else (ex. a service to be available like line 60 in clearpath_bt_joy_cutoff_node.py) vs it is ready and operational
- Consider whether the quality or timeout should be configurable from the robot.yaml
clearpath_bt_joy/clearpath_bt_joy/clearpath_bt_joy_cutoff_node.py
Outdated
Show resolved
Hide resolved
clearpath_bt_joy/clearpath_bt_joy/clearpath_bt_joy_cutoff_node.py
Outdated
Show resolved
Hide resolved
{'topics.joy.timeout': 0.5}, | ||
{'topics.joy.priority': 10}, | ||
{'locks.bt_quality.topic': 'joy_teleop/bt_quality_stop'}, | ||
{'locks.bt_quality.timeout': 0.0}, |
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.
This has the quality timeout disabled, it would be "safer" to timeout on a stale quality topic. Let's discuss
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've added a 1s timeout after discussing on Slack.
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.
Made a few further changes to the code for non-bluetooth controllers to work around the timeout. Since if the controller doesn't have a MAC it's most likely using a dongle or it's wired, we just publish full quality. If the device is then unplugged it will stop publishing anyway, so the quality cutoff is irrelevant.
clearpath_bt_joy/clearpath_bt_joy/clearpath_bt_joy_cutoff_node.py
Outdated
Show resolved
Hide resolved
Updated the MR description to reflect changes to topic names, just in case we ever refer back to this down the road. |
…added a timeout to the lock, publish fake quality data when using wired controllers. Log when this happens
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.
Looks good to me
Overview
Block inputs when signal quality is poor
Adds a new
clearpath_bt_joy
package which contains a node that monitors the link quality of the connection to the game controller and uses that to publish aquality_ok
topic that can be used a lock to atwist_mux
node.The joy controller topics & nodes are slightly reworked, with some new hidden topics. Everything remains API compatible with the existing layout.
Previously:
joy_linux
publishesjoy_teleop/joy
teleop_twist_joy
subscribes tojoy_teleop/joy
, publishesjoy_teleop/cmd_vel
Now:
joy_linux
still publishesjoy_teleop/joy
teleop_twist_joy
publishesjoy_teleop/_cmd_vel
(hidden topic)clearpath_bt_joy
publishesjoy_teleop/quality
andjoy_teleop/bt_quality_stop
as new topicstwist_mux
subscribes tojoy_teleop/_cmd_vel
as the input andjoy_teleop/bt_quality_stop
as a lock, publishingjoy_teleop/cmd_vel
as the outputBy relying on the
bluez
package'shcitool lq MAC_ADDR
command, we avoid adding any additional systemd jobs or modifying the OS's joy controller drivers; we just passively monitor the link quality and use thetwist_mux
's lock input to disable the controller input when needed.Context
Linux game controllers latch their last-received command for a brief period when the connection to the controller is lost. When dealing with a physical robot this can cause a dangerous situation where the robot is literally untrontrollable for a brief window of time.
Previously we used the DS4DRV package to mitigate this, but that package was specific to the PS4/DualShock controller, which we may be moving away from.
Add support for additional common controllers
Adds udev rules & configuration files for PS4, Xbox, Logitech game controllers. PS5 pending, though may be compatible with PS4 (untested so far)
Logitech controller udev rules removed from clearpath_robot and moved here. See clearpathrobotics/clearpath_robot#113
Additional controllers added to clearpath_config here: clearpathrobotics/clearpath_config#105