moveit2_tutorials icon indicating copy to clipboard operation
moveit2_tutorials copied to clipboard

add spacenav example

Open borongyuan opened this issue 2 years ago • 9 comments

Description

Add a simple spacenav example, only launch file. Need to wait for https://github.com/ros-drivers/joystick_drivers/pull/251 to be merged. There I added an option to make spacenav_node publish TwistStamped directly.

Checklist

  • [ ] Required by CI: Code is auto formatted using clang-format
  • [ ] While waiting for someone to review your request, please consider reviewing another open pull request to support the maintainers

borongyuan avatar Feb 15 '23 08:02 borongyuan

Thanks for your effort. According to https://github.com/ros-planning/moveit_tutorials/issues/754#issuecomment-1415648174, spacenav_node and the corresponding spacenavd are not needed anymore. It would be great if you could try the approach suggested in the linked issue (and thus getting rid of the special spacenav stuff).

rhaschke avatar Feb 15 '23 12:02 rhaschke

Can you be more specific, @rhaschke? Are you against adding any spacenav functionality completely?

AndyZe avatar Feb 15 '23 13:02 AndyZe

Can you be more specific, @rhaschke? Are you against adding any spacenav functionality completely?

I suggest to drop spacenav_node specific stuff and operate the space mouse directly via joystick software (only one thing to maintain in future).

rhaschke avatar Feb 15 '23 16:02 rhaschke

I suggest to drop spacenav_node specific stuff and operate the space mouse directly via joystick software (only one thing to maintain in future).

Yes, this is what I want. As long as the joystick software can directly publish TwistStamped, other nodes for message conversion can be removed. Replacing Twist with TwistStamped is useful in future applications. This is also discussed and followed up in other packages. https://github.com/ros-teleop/teleop_tools/pull/54 https://github.com/ros-planning/navigation2/issues/1594 So it's best to handle this part in joystick_drivers.

borongyuan avatar Feb 16 '23 05:02 borongyuan

So it's best to handle this part in joystick_drivers.

not really, I believe.

joystick_drivers should care about interfacing with joysticks and gamepads. It should not have anything to do with conversion to arbitrary other messages.

That's what the packages in ros/ros-teleop can be used for.

gavanderhoorn avatar Feb 16 '23 08:02 gavanderhoorn

joystick_drivers should care about interfacing with joysticks and gamepads. It should not have anything to do with conversion to arbitrary other messages.

The Joy message is a generic message for all types of joysticks. ros-teleop can be used to define the function of any joystick. While the SpaceMouse is a 6DoF Joystick. So it's reasonable to publish Twist directly. This makes it easier to get started and also reduces delay. We can still use ros-teleop to configure the function of its buttons. For conversion to other messages, cartesian_controllers also provides some references.

borongyuan avatar Feb 16 '23 09:02 borongyuan

We used teleop_tools in ROS1. It was pretty easy to configure :+1:

https://github.com/ros-planning/moveit/blob/master/moveit_ros/moveit_servo/config/spacenav_via_teleop_tools.yaml

AndyZe avatar Feb 16 '23 14:02 AndyZe

This pull request is in conflict. Could you fix it @borongyuan?

mergify[bot] avatar Aug 14 '23 14:08 mergify[bot]

This pull request is in conflict. Could you fix it @borongyuan?

mergify[bot] avatar Dec 15 '23 03:12 mergify[bot]