Abstract
We begin this tutorial by discussing the features of the Catkin build system. We then proceed by giving a thorough explanation of ROS callback functions in terms of sensor data. We utilize the Qt5 libraries to make a very simple Graphical User Interface to control the robot with on screen buttons, as well as view position information in \((x, y, \theta )\) coordinates. This GUI will use the Qt thread library as well as ROS messages to control and provide information about the state of the robot.
Special thanks to Dr. Julie A. Adams.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
This command is only found when Qt5Core is in the build environment. This command is also only available in CMake versions 2.8.9 and later.
- 2.
Note that this is by no means a requirement: one may implement the UI with Qt Designer if one so chooses, as was mentioned in Sect. 3.2.
- 3.
close() is a function inherited from QWidget that closes the window.
- 4.
This is the standard topic for such a message; however, the reader is encouraged to find a way to initialize this with a variable topic [Hint: add a const char * to the constructor which defaults to “cmd_vel”].
References
Hunter Allen’s Git Repository. http://github.com/allenh1/ros-qt-controller
Creating a Catkin Workspace. http://wiki.ros.org/catkin/Tutorials/create_a_workspace
R.E.P. 140. http://www.ros.org/reps/rep-0140.html
ROS Threading Tutorial Package. https://github.com/allenh1/ros-thread-tutorial
CMake Commands. http://www.cmake.org/cmake/help/v3.0/manual/cmake-commands.7.html
Qt Translation. http://doc.qt.io/qt-5/i18n-source-translation.html
Qt Online Documentation. https://doc-snapshots.qt.io
QMutex Class. http://doc.qt.io/qt-5.4/qmutex.html
Video Demonstration of Controller. https://vimeo.com/123502207
ROS Wiki, Catkin Build. http://wiki.ros.org/catkin
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Allen, H.L. (2016). Threaded Applications with the roscpp API. In: Koubaa, A. (eds) Robot Operating System (ROS). Studies in Computational Intelligence, vol 625. Springer, Cham. https://doi.org/10.1007/978-3-319-26054-9_3
Download citation
DOI: https://doi.org/10.1007/978-3-319-26054-9_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-26052-5
Online ISBN: 978-3-319-26054-9
eBook Packages: EngineeringEngineering (R0)