Skip to content

Commit ac75335

Browse files
committed
Removed selective_camera_display from rviz_plugin_tutorials.It had no descriptive text and the API has changed since it was written.
1 parent 5e57ac9 commit ac75335

File tree

7 files changed

+18
-199
lines changed

7 files changed

+18
-199
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*~
22
bin
33
build
4+
lib

rviz_plugin_tutorials/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ qt4_wrap_cpp(MOC_FILES
2121
src/drive_widget.h
2222
src/teleop_panel.h
2323
src/imu_display.h
24-
src/selective_camera_display.h
2524
)
2625

2726
## Here we specify the list of source files, including the output of
@@ -32,7 +31,6 @@ set(SOURCE_FILES
3231
src/plant_flag_tool.cpp
3332
src/imu_display.cpp
3433
src/imu_visual.cpp
35-
src/selective_camera_display.cpp
3634
${MOC_FILES}
3735
)
3836

rviz_plugin_tutorials/plugin_description.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
Displays direction and scale of accelerations from sensor_msgs/Imu messages.
1414
</description>
1515
</class>
16-
<class name="rviz_plugin_tutorials/SelectiveCamera"
17-
type="rviz_plugin_tutorials::SelectiveCameraDisplay"
18-
base_class_type="rviz::Display">
19-
<description>
20-
Shows an alternate view of the 3D scene in its own widget.
21-
</description>
22-
</class>
2316
<class name="rviz_plugin_tutorials/PlantFlag"
2417
type="rviz_plugin_tutorials::PlantFlagTool"
2518
base_class_type="rviz::Tool">

rviz_plugin_tutorials/src/selective_camera_display.cpp

Lines changed: 0 additions & 103 deletions
This file was deleted.

rviz_plugin_tutorials/src/selective_camera_display.h

Lines changed: 0 additions & 64 deletions
This file was deleted.

rviz_plugin_tutorials/src/teleop_panel.cpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
#include <QLabel>
3737
#include <QTimer>
3838

39-
#include <yaml-cpp/emitter.h>
40-
#include <yaml-cpp/node.h>
41-
4239
#include <geometry_msgs/Twist.h>
4340

4441
#include "drive_widget.h"
@@ -119,11 +116,11 @@ void TeleopPanel::setVel( float lin, float ang )
119116
// away.
120117
void TeleopPanel::updateTopic()
121118
{
122-
setTopic( output_topic_editor_->text().toStdString() );
119+
setTopic( output_topic_editor_->text() );
123120
}
124121

125122
// Set the topic name we are publishing to.
126-
void TeleopPanel::setTopic( const std::string& new_topic )
123+
void TeleopPanel::setTopic( const QString& new_topic )
127124
{
128125
// Only take action if the name has changed.
129126
if( new_topic != output_topic_ )
@@ -140,7 +137,7 @@ void TeleopPanel::setTopic( const std::string& new_topic )
140137
// and thus the old topic advertisement is removed. The call to
141138
// nh_advertise() says we want to publish data on the new topic
142139
// name.
143-
velocity_publisher_ = nh_.advertise<geometry_msgs::Twist>( output_topic_, 1 );
140+
velocity_publisher_ = nh_.advertise<geometry_msgs::Twist>( output_topic_.toStdString(), 1 );
144141
}
145142
// rviz::Panel defines the configChanged() signal. Emitting it
146143
// tells RViz that something in this panel has changed that will
@@ -173,22 +170,21 @@ void TeleopPanel::sendVel()
173170
}
174171

175172
// Save all configuration data from this panel to the given
176-
// YAML::Emitter. It is important here that you call saveChildren()
173+
// Config object. It is important here that you call save()
177174
// on the parent class so the class id and panel name get saved.
178-
void TeleopPanel::saveChildren( YAML::Emitter& emitter )
175+
void TeleopPanel::save( rviz::Config config ) const
179176
{
180-
rviz::Panel::saveChildren( emitter );
181-
emitter << YAML::Key << "Topic" << YAML::Value << output_topic_;
177+
rviz::Panel::save( config );
178+
config.mapSetValue( "Topic", output_topic_ );
182179
}
183180

184-
// Load all configuration data for this panel from the given YAML Node.
185-
void TeleopPanel::loadChildren( const YAML::Node& yaml_node )
181+
// Load all configuration data for this panel from the given Config object.
182+
void TeleopPanel::load( const rviz::Config& config )
186183
{
187-
if( const YAML::Node *topic_node = yaml_node.FindValue( "Topic" ))
184+
QString topic;
185+
if( config.mapGetString( "Topic", &topic ))
188186
{
189-
std::string topic;
190-
*topic_node >> topic;
191-
output_topic_editor_->setText( QString::fromStdString( topic ));
187+
output_topic_editor_->setText( topic );
192188
updateTopic();
193189
}
194190
}

rviz_plugin_tutorials/src/teleop_panel.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
#ifndef TELEOP_PANEL_H
3030
#define TELEOP_PANEL_H
3131

32-
#include <string>
33-
3432
#include <ros/ros.h>
3533

3634
#include <rviz/panel.h>
@@ -66,10 +64,10 @@ Q_OBJECT
6664
TeleopPanel( QWidget* parent = 0 );
6765

6866
// Now we declare overrides of rviz::Panel functions for saving and
69-
// loading data from the YAML config file. Here the data is the
67+
// loading data from the config file. Here the data is the
7068
// topic name.
71-
virtual void loadChildren( const YAML::Node& yaml_node );
72-
virtual void saveChildren( YAML::Emitter& emitter );
69+
virtual void load( const rviz::Config& config );
70+
virtual void save( rviz::Config config ) const;
7371

7472
// Next come a couple of public Qt slots.
7573
public Q_SLOTS:
@@ -81,7 +79,7 @@ public Q_SLOTS:
8179
// (it is called directly), but it is easy to define it as a public
8280
// slot instead of a private function in case it would be useful to
8381
// some other user.
84-
void setTopic( const std::string& topic );
82+
void setTopic( const QString& topic );
8583

8684
// Here we declare some internal slots.
8785
protected Q_SLOTS:
@@ -104,7 +102,7 @@ protected Q_SLOTS:
104102
QLineEdit* output_topic_editor_;
105103

106104
// The current name of the output topic.
107-
std::string output_topic_;
105+
QString output_topic_;
108106

109107
// The ROS publisher for the command velocity.
110108
ros::Publisher velocity_publisher_;

0 commit comments

Comments
 (0)