2.66 KB
Newer Older
1 2
<!-- (c) -->
# How to install everything
Philipp Helios's avatar
Philipp Helios committed
- Download Carla (We are using the precompiled version 0.9.5, because this is the latest version that was supported by the ros-bridge at the time) from ``
4 5 6
- Extract it
- If the file carla-0.9.5-py2.7-linux-x86_64.egg is not present inside the PythonAPI folder copy it there from PythonAPI/carla/dist
- Install Docker
Philipp Helios's avatar
Philipp Helios committed
- If you want to build the CarlaRosBridge Docker Container yourself you can use the scripts in docker/carla-ros-bridge; note that we use the tag of the carla-ros-bridge as the latest version is not compatible with Carla 0.9.5 anymore
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

# How to run it on Linux
## How to execute the code for the bumper bot and read the collision sensor?

- Start Carla by executing: ``
- Execute in PythonAPI/examples to create a vehicle for the ros-bridge: `python --rolename=ego_vehicle`  
- To start the container execute inside the project folder:  

Then execute in a new terminal to compile and execute the generated code for the bumpbot:  

If you want to read additional messages from a rostopic you can execute:  
`docker/bumpbot/` and inside the container read the topic with e.g. `rostopic echo /carla/ego_vehicle/collision`

# Running with docker on Windows
Philipp Helios's avatar
Philipp Helios committed
24 25 26
I tested this code in a Command Prompt/Power Shell. For the use of other consoles the commands might need to be adjusted for example with winpty.

Similarly to how you run it on Linux, there are the, and scripts. Depending on your system, these might need to be edited.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

## Running the code
- In the Docker Settings GUI select the drive where you want to work on as shared drive, else using volumes won't work.

### Updating the IP where carla is running
As we don't have a predefined docker network to the host we have to specify the IP where carla is reachable as follows and rebuild the ros-bridge:

- `sed -i 's/<yourIP>/g' /opt/carla-ros-bridge/src/carla_ros_bridge/config/settings.yaml`
- `source /opt/ros/kinetic/setup.bash; cd  /opt/carla-ros-bridge; catkin_make -DCMAKE_BUILD_TYPE=Release install`
- `source /opt/carla-ros-bridge/devel/setup.bash`
- `roslaunch carla_ros_bridge carla_ros_bridge.launch`

### Compile and exec
- This script should work exectly as with Linux:
- `docker exec -it emam2carla bash -c 'source /opt/ros/kinetic/setup.bash && cd /usr/src/emam2carla/EMAM2Carla/ && rm -rf target && java -jar ../mw-generator.jar valid.json && target/ && target/build/test_bumpBot/coordinator/Coordinator_test_bumpBot'`