This page sums up all the external objects used in this package. It allows to avoid long links in the code: references to external documentation (with their long links) are gathered here, and are replaced by (short) ref commands in the code.
The ROS node class uses several functions of the ROS namespace: init(int&, char**, const std::string&)
, init(const M_string&, const std::string &)
, start()
, ok()
, spinOnce()
, isStarted()
, shutdown()
and waitForShutdown()
.
The ros/console.h
file offers several macros to generate logs at different levels. The method ROSnode::log() uses the ROS_LOG_STREAM()
macro.
The ROS node class of this package uses a ros::Publisher
instance to send velocity commands to the robot, with its publish()
method. This publisher is obtained with the NodeHandle::advertise(const std::string&, unsigned int32_t)
method.
The ROS node class of this package uses a ros::Subscriber
instance to get odometry values. This subscriber is obtained with the NodeHandle::subscribe(const std::string&, unsigned int32_t, ...)
method.
The method ROSnode::run() uses a ros::Rate
instance to setup the frequency of its main loop with its sleep()
method.
The method ROSnode::log() uses the ros::Time::now()
method to date logs in the GUI.
A ros::Time is also used to date the odometry data.
The method ROSnode::run() also uses a geometry_msgs::Twist
instance to publish (using its command publisher) the desired velocity to ROS.
Odometry data are transmitted using a nav_msgs::Odometry
instance. A ROS subscriver is used to indicate which method should handle these data.
The main function uses a QApplication
instance, whose main method is exec()
.
The GUI is a child of Qt class QMainWindow
. It is the container of the teleoperation widget.
The GUI uses a QMenuBar
instance to hold main menus.
The menu bar of the GUI uses QMenu
instances.
The GUI uses a QToolBar
instance to hold buttons.
The GUI uses QAction
instances to define both buttons and menu items.
The teleoperation widget is a child of Qt class QWidget
.
The ROS node class is a child of Qt class QThread
. Its run() method (i.e. the ROS control node) executes in a thread which is independant from the one handling the graphical interface (i.e. the main thread).
Qt graphical objects are not thread-safe: if such an object is modified by a thread which is not the main one (which runs the graphical event loop), the programm may abort with segmentation violation.
The only secure way to get this modification is to emit a signal in the thread which is not the main, the signal beeing caught by the main thread and connected to the method which handles the modification.
When a key of the keyboard is pressed, it generates a key event whose key() method gives the key number, according to Qt table.
The ROS node class uses a QStringListModel
instance to display log messages in the Qt GUI.
The GUI uses a QListView
instance to display the log messages sent to ROS by the ROS node.
The Qt class QSignalMapper
allows to connect several buttons to a unique method, mapping each button to a parameter transmitted to the method.
As Qt 5 handles lambda functions, the QSignalMapper
class became obsolete. However, ROS currently only works with Qt 4, making this class necessary.