It’s easier to just compile the code on the raspberry pi, it’s a bit slow but not a real problem. This is a quick follow up post.
Configuration of cmake
First a CMakeLists.txt file should be made in the main project directory. For example I used the following file from the documentation and changed it a bit.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) # Set your project name and version PROJECT (playerstagetest) SET(PROJECT_VERSION 0.0.1 CACHE STRING "CMake Example Project Version Number") # Build flags for different configurations # Use is determined by the option CMAKE_BUILD_TYPE set(CMAKE_BUILD_TYPE "DEBUG") set(CMAKE_C_FLAGS_DEBUG "-g -Wall ") set(CMAKE_C_FLAGS_RELEASE "-O2 ") set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall ") set(CMAKE_CXX_FLAGS_RELEASE "-O2 ") # If Player isn't installed to /usr, you'll have to edit this path to point # to the location of UserPlayerC++.cmake and UsePlayerPlugin.cmake SET (CMAKE_MODULE_PATH "/usr/local/share/cmake/Modules") # These files include macros that make building against Player easier. They provide # the PLAYER_ADD* macros INCLUDE (UsePlayerC++) INCLUDE (UsePlayerPlugin) # This command adds an example PlayerC++ client called 'exampleclient', using # the 'exampleclient.cc' source file. PLAYER_ADD_PLAYERCPP_CLIENT (exampleclient SOURCES main.cpp) # If you also want to include a Player plugin driver, use these directions: # This command adds an example plugin driver which will be called 'libexampledriver.so' # which uses the source file 'exampleplugin.cc' # PLAYER_ADD_PLUGIN_DRIVER (exampledriver SOURCES exampleplugin.cc) #add_executable(playerstagetest main.cpp) |
Now copy the complete project DIR to the Raspberry Pi and then create a build directory. In the build directory run the following command:
|
1 2 3 |
mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Debug /home/pi/PlayerProjects/PlayerStageTest/ |
The last value is the location of your PlayerStage Project. We only need to run this command once for the project, if we change our main.cpp we don’t need to run this command. Next we can run make to create our program.
|
1 |
make |
The main advantage is that you can fully develop using Stage on your main computer and then export your source to the Raspberry Pi and run in there. One thing I don’t know if its possible to just run the player server and client at the same time. This means that you configure the player server for a specific robot and link it with the client file.
By changing the following line PlayerClient robot(“192.168.0.184″); I’m able to test out the player client on my Raspberry Pi and connect it with the player server running on my laptop.
So I’ve successfully installed Player on the Raspberry Pi. Now it’s waiting for the robot too arrive.


