Skip to content
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

controller_type:="analog" causes crash #50

Open
fredrikbaberg opened this issue Jun 23, 2016 · 5 comments
Open

controller_type:="analog" causes crash #50

fredrikbaberg opened this issue Jun 23, 2016 · 5 comments

Comments

@fredrikbaberg
Copy link

I'm trying to run jaco_teleop with jaco2 as follows, with a Xbox 360 wireless gamepad:
roslaunch jaco_teleop joystick_teleop.launch controller_type:="analog"

After calibrating I get the following error:
_terminate called after throwing an instance of 'std::out_of_range'
what(): vector::M_range_check
This does not happen with "digital", but the I can't control the arm properly.

(this is for the version through apt-get, I'm in the process of testing it after compiling from source)

@dekent
Copy link
Contributor

dekent commented Jun 26, 2016

If you run the ros joy node and echo the /joy topic, what values change when you press the left trigger and the right trigger?

This is probably an issue with a different button/axis mapping on the ros topic. We use either a logitech wireless gamepad or a wired Xbox 360 gamepad. If the mapping is different, you'll need to remap the button configuration with something like joystick_remapper.

@fredrikbaberg
Copy link
Author

What I get is: "axes: [0.0, 0.0, 1.0, -0.0, 0.0, 1.0]", so axis 2 and 5 (if counting starts on 0).
I've compared to "Microsoft Xbox 360 Wired Controller for Linux" on http://wiki.ros.org/joy, and the difference I find is that the cross keys are buttons, not axis. They map as follows (indexing starts at zero):
11 - Cross key left
12 - Cross key right
13 - Cross key up
14 - cross key down

@dekent
Copy link
Contributor

dekent commented Jun 27, 2016

Ah, I see. The controllers we've tested add the cross keys to the axes array instead of the buttons array, so the teleop code is polling for out of range values. For now I can upload a quick fix so it doesn't crash on you. The cross key functionality (displaying help in the terminal) won't work, but you should be able to control the arm.

@dekent
Copy link
Contributor

dekent commented Jun 27, 2016

Try pulling from the develop branch now. I can do a more complete fix later!

@fredrikbaberg
Copy link
Author

Thank you! I have tried it and it works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants