Skip to Content
Mastering ROS for Robotics Programming - Second Edition
book

Mastering ROS for Robotics Programming - Second Edition

by Lentin Joseph, Jonathan Cacace
February 2018
Beginner
580 pages
13h 20m
English
Packt Publishing
Content preview from Mastering ROS for Robotics Programming - Second Edition

Step 3 – Creating the RViz plugin definition

In this step, we will create the main C++ file that contains the definition of the plugin. The file is teleop_pad.cpp, and you will get it from the src package folder.

The main responsibilities of this file are as follows:

  • It acts as a container for a Qt GUI element, such as QLineEdit, to accept text entries
  • It publishes the command velocity using the ROS publisher
  • It saves and restores the RViz config files

The following is the explanation for each section of the code:

TeleopPanel::TeleopPanel( QWidget* parent ) 
  : rviz::Panel( parent ) 
  , linear_velocity_( 0 ) 
  , angular_velocity_( 0 ) { 

This is the constructor and initialize rviz::Panel with QWidget, setting linear and angular velocity as

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering ROS for Robotics Programming - Third Edition

Mastering ROS for Robotics Programming - Third Edition

Lentin Joseph, Jonathan Cacace
Effective Robotics Programming with ROS - Third Edition

Effective Robotics Programming with ROS - Third Edition

Luis Sanchez, Enrique Fernandez Perdomo, Anil Mahtani

Publisher Resources

ISBN: 9781788478953Supplemental Content