Skip to content
Snippets Groups Projects

TorcsClient is a C++ application that connects to Torcs and receives images via shared memory (FreeImage library is used to read and store images).

EMAM2RosCpp https://github.com/EmbeddedMontiArc/EMAM2RosCpp and EMAM2RosMsg https://github.com/EmbeddedMontiArc/EMAM2RosMsg are used to generate ROS code from EmbeddedMontiArc.

Prerequisites

  • Ubuntu 16.04
  • ROS lunar

TorcsClient

  • Compile torcs: ..* Install dependencies: libopenal-dev libalut-dev libplib-dev libvorbis-dev ..* 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

  • Install libfreeimage-dev

ROS

Installation

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)

Find string: # add_executable(${PROJECT_NAME}_node src/torcs2_node.cpp) in the RosWorkspace/src/torcs2/CMakeLists.txt file, uncomment and change to: add_executable(${PROJECT_NAME} src/torcs2.cpp)

Find and uncomment in the same file:

target_link_libraries(${PROJECT_NAME}_node
  ${catkin_LIBRARIES}
)

and remove _node suffix to get:

target_link_libraries(${PROJECT_NAME}
  ${catkin_LIBRARIES}
)
  • Run catkin_make and catkin_make install as described in tutorial. Check that package is now available: rospack list | grep torcs

  • Run node with the package: rosrun torcs torcs

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