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

Cannot control the car in Gazebo with keyboard : Car won't move #25

Closed
GuillaumeHauss opened this issue Nov 2, 2017 · 4 comments
Closed

Comments

@GuillaumeHauss
Copy link

Hi all,

I don't have a joystick so I'm controlling the car using the keyboard. It was working perfectly well so far.
However, I wanted to see if I could use the launch script on plain Kinetic, without Docker.
When I tried to catkin_make, it said that the package ignition-msgs0 was not found. So I manually installed libignition-msgs0 with

sudo apt-get install libignition-msgs0

However, the caktin_make command kept crashing on dependancies, so I gave up on this, and decided to stay with the Docker setup. But now, when I launch the simulation, the car doesn't move according to keyboard letters pressed. In fact, it doesn't move at all.
I've checked in the Docker container that the librairy was still loaded and it is there:

/usr/lib/x86_64-linux-gnu

alongside with

libignition-math3

I don't have the slicest idea of where to look next to find where the bridge is broken between the keyboard and the simulation.
It's my fault, I should have stayed with the original setup, sorry for bothering you.

Have a nice day
Guillaume

@tfoote
Copy link
Contributor

tfoote commented Nov 2, 2017

The demo only launches the joystick teleoperation nodes. If you want to use keyboard control you'll need to add appropriate nodes to capture the keyboard input and map those it to the topics for the demo like we do for the joystick: https://github.com/osrf/car_demo/blob/master/car_demo/nodes/joystick_translator

If you'd like to implement this and submit a PR we'd be happy to review and merge it but since this is a demo repository we're not actively developing on it.

@tfoote tfoote closed this as completed Nov 2, 2017
@GuillaumeHauss
Copy link
Author

Hi,
Actually, there's a keyboard input management in the PriusHybridPlugin here. It's pretty basic : forward, backward, steer left and right, brake but it gets the job done.

In the mcity.world file, there is this tag:
<gui fullscreen='0'> <plugin name='keyboard' filename='libKeyboardGUIPlugin.so'/> <camera name="user_camera"> <pose>89.90 -309.03 10.39 0 0.24 1.63</pose> </camera> </gui>

I didn't try to get rid of it, as I couldn't find any documentation on that type of plugin in Gazebo on the official website.

Anyway, I download the whole repo, build the Docker image and run it all again, and it works now. I guess it was some stuff going on with Docker cache and previous image that got messed up. I saw in the trace log that it was using a lot of cache IDs. Do you have any tips on that matter?

This issue is closed though, thank you for your time

@iche033
Copy link
Contributor

iche033 commented Nov 2, 2017

The KeyboadGUIPlugin just publishes key chars to ~/keyboard/keypress gazebo topic which are then handled by PriusHybridPlugin. It should come installed in gazebo versions 7+ so not sure why it wasn't working for you before. Maybe the GAZEBO_PLUGIN_PATH was overridden somehow so it wasn't loading the plugin.

@GuillaumeHauss
Copy link
Author

Thanks for the info! I should definitely not get rid of it in the world file. When typing echo $GAZEBO_PLUGIN_PATH, I have /usr/lib/x86_64-linux-gnu/gazebo-7/plugins:. It seems okay to me.
Final message from me, I won't be bothering you on that matter anymore

Have a nice day :)

pushkalkatara pushed a commit to pushkalkatara/prius_gazebo that referenced this issue Mar 2, 2019
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

3 participants