ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Joystick control for interactive markers

asked 2014-06-25 18:32:26 -0500

anonymous user



I intend to use a joystick to move the interactive marker in MoveIt (in Hydro) to position the goal state for my robot arm.

My first approach has been to try and adapt code from @danep found here: link

The issue is i am uncertain how to uncouple the Phantom Omni components and instead pair it with my joystick publishing on the /joy topic with type sensor_msgs/Joy.

Does anyone have insight on this or another approach?



edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-06-28 22:44:33 -0500

kramer gravatar image

On a cursory look at the linked code, you just need to replace the omni callbacks with one for your joystick. That is, rather than the two subscribers and their callbacks for the omni, you can use just one of each for the joystick.

Then you need to change the transforms from handling the omni's output (a pose in its own frame) to the joystick output (which I assume you want to be a relative change in the marker's frame). Whereas the code you referenced simply copies a modified transform of the omni pose into an 'InteractionCursorUpdate' message, you'd want to modify the current marker pose according to your received joystick message. You can just get rid of any 'stylus' frames, as you'll (likely) just be working in the marker's frame.

I'm not sure how you're planning on mapping the inputs, but for instance, keeping 'p' as the update.pose, pushing forward on the joystick might result in a 'p.position.x += joy.axes[0]' line of code. Or, maybe you want pushing forward to pitch, so you'd have to modify the quaternion instead.

Disclaimer: I'm not familiar with the omni (working with a sixaxis) nor do I work in python (C++).

edit flag offensive delete link more


Thanks, I was able to achieve the result using this technique of editing the omin functions.

anonymous userAnonymous ( 2014-09-08 16:05:29 -0500 )edit

answered 2014-06-29 07:04:48 -0500

gvdhoorn gravatar image

You might also be interested in PR #471 on the moveit_ros repository. This is work done by Ryohei, which adds a joystick interface to the MoveIt RViz plugin.

edit flag offensive delete link more

Question Tools



Asked: 2014-06-25 18:32:26 -0500

Seen: 850 times

Last updated: Jun 29 '14