ROS keyboard controller for CARLA simulator
Using the curses library I wasn't sure how to capture multiple keys being pressed at the same time.
This makes it difficult to turn.
- Make sure you have CARLA installed
- Navigate to catkin_ws directory and
source devel/setup.bash
- I wrote down that I did this but I don't exactly remember what it does or if it's necessary:
echo "source ~/path_to_carlaController/carlaController/catkin_ws/devel/setup.bash >> ~/.bashrc
Not really sure if these are all the setup instructions because I'm not familiar with using catkin_ws and I forgot exactly what I did but should be able to find solutions for problems on stackoverflow or GitHub issues pretty easily. Sorry about that.
-
Make sure CARLA simulator is already running. On the lab machine I use the command:
~/CarlaUE4.sh -windowed -ResX=600 -ResY=400
but it will differ based on where your CARLA is. -
Run roscore:
roscore
-
Run the launch file:
roslaunch carlaController keyboardStuff.launch
This should spawn a car in the CARLA environment and change the spectator camera to view the car. -
In the terminal where you ran the launch file you should be able to press keys to control the car.
w = forward
a = left
s = backwards
d = right
space = brake