README.md 2.02 KB
Newer Older
Svetlana's avatar
Svetlana committed
1
*TorcsClient* is a C++ application that connects to Torcs and receives images via shared memory (FreeImage library is used to read and store images).
2

Svetlana's avatar
Svetlana committed
3
*EMAM2RosCpp* <https://github.com/EmbeddedMontiArc/EMAM2RosCpp> and *EMAM2RosMsg* <https://github.com/EmbeddedMontiArc/EMAM2RosMsg> are used to generate ROS code from EmbeddedMontiArc.
4 5


Svetlana's avatar
Svetlana committed
6
## Prerequisites
7

Svetlana's avatar
Svetlana committed
8 9
* Ubuntu 16.04
* ROS lunar
10

Svetlana's avatar
Svetlana committed
11
## TorcsClient
12

Svetlana's avatar
Svetlana committed
13 14
* Compile torcs:
..* Install dependencies: `libopenal-dev libalut-dev libplib-dev libvorbis-dev`
Svetlana's avatar
Svetlana committed
15 16
..* cd to torcs directory and run: `./configure --prefix/opt/torcs && make -j && sudo make install && sudo makeinstall`
..* Test if it runs by starting `/opt/torcs/bin/torcs`
Svetlana's avatar
Svetlana committed
17 18 19 20 21

* Install `libfreeimage-dev`

## ROS

22 23
### Installation

Svetlana's avatar
Svetlana committed
24 25 26 27 28 29 30 31 32 33 34
* libarmadillo-dev package
`sudo ln -s /usr/include/armadillo /usr/include/armadillo.h`	

* Follow ROS installation instructions on <http://wiki.ros.org/lunar/Installation/Ubuntu>

* Follow instructions to create a package on <http://wiki.ros.org/ROS/Tutorials/CreatingPackage>

We use `RosWorkspace/` as the ROS workspace directory and `RosWorkspace/src/torcs2` as the package directory example.

* Generate sources via EMAMRosCpp
* Copy sources into created package src directory (RosWorkspace/src/torcs2/src)
35 36

Find string:
Svetlana's avatar
Svetlana committed
37
`# add_executable(${PROJECT_NAME}_node src/torcs2_node.cpp)`
38
in the RosWorkspace/src/torcs2/CMakeLists.txt file, uncomment and change to:
Svetlana's avatar
Svetlana committed
39
`add_executable(${PROJECT_NAME} src/torcs2.cpp)`
40 41

Find and uncomment in the same file:
Svetlana's avatar
Svetlana committed
42
```
43 44 45
target_link_libraries(${PROJECT_NAME}_node
  ${catkin_LIBRARIES}
)
Svetlana's avatar
Svetlana committed
46
```
47

Svetlana's avatar
Svetlana committed
48 49
and remove _node suffix to get:
```
50 51 52
target_link_libraries(${PROJECT_NAME}
  ${catkin_LIBRARIES}
)
Svetlana's avatar
Svetlana committed
53
```
54

Svetlana's avatar
Svetlana committed
55 56
* Run `catkin_make` and `catkin_make install` as described in tutorial.
Check that package is now available: `rospack list | grep torcs`
57

Svetlana's avatar
Svetlana committed
58
* Run node with the package: `rosrun torcs torcs`
59

60 61 62 63 64 65 66
### Our ROS Packages

* Go to RosWorkspace directory
* Run `catkin_make` to compile our packages
* Run `source devel/setup.bash` to setup environment
* Run `rospack list` and check that it shows our packages among others