Ask Your Question
0

Joystick control for interactive markers

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

cmeaclem gravatar image

Hi,

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?

Cheers,

Chris

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

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

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

Comments

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

cmeaclem gravatar imagecmeaclem ( 2014-09-08 16:05:29 -0600 )edit
0

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 616 times

Last updated: Jun 29 '14