The following Jenkins job demonstrates how to run
- ROS commands together with
- turtlesim simulator and
- automatic tests
Job description:
- The job starts the major ROS process – roscore in job’s workspace
- Then the job starts the turtlesim simulator
- The script executes three tests:
- Test1. It pings the turtlesim node and cheks that it responds
- Test2. Cheks that the turtle initial position is as expected
- Test3. Move the turtle and checks turtle arrived at expected position
- See ROS+Jenkins bash script that executes all this
Notes:
- You need to daemonize the roscore and turtlesim processes in order to start the ROS environment and the Turtlesim simulator from inside the Jenkins job. Otherwise you get errors like: “Process leaked file descriptors”. Read more at Spawning processes from build and download daemonize from A tool to run a command as daemon.
- You also need to configure Jenkins job to use the “Run Xvnc during build” option. Otherwise Turtlesim will not start. Of course, you need first to install Xvnc plug-in to Jenkins. And also install vnc4server on your machine.
- Configure the Jenkins job with “Publish JUnit test result report” option and print the tests results Passed/Failed in an XML file. The XML should look like this, at StackOverflow or see a more general description at Windyroad
Optional:
- Roscore can be started as a separate process, before starting the Jenkins Job
- Also the turtle simulator can be started before starting the Jenkins Job – a window with a turtle in the middle will pop-up
- Remove from Jenkins job the code that starts roscore and the turtle. The job contains now only pinging and moving the turtle
- Run the job. As a result, you will see the turtle moving around
- Also as a result all tests in Jenkins will Pass/Fail as before
- Which means that Jenkins can easily run the failed tests and in the same time, be viewed in the simulator.
Useful Links:
- Get started with ROS+Gtest – Sharp Robotica Tutorial
- A Reference on Gtest – ROS tutorial on Gtest
- Gtest Primer on Google site
- All tutorials on ROS
- Visualize a simulation started inside Jenkins (use a vncserver) – Integrate ROS and Jenkins
- Example on how to drive the turtle simulator from inside a C++ program

ROS Tutorials
Leave a Reply