Merge remote-tracking branch 'origin/master' into online_version
commit
86d0b5519f
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
@ -4,6 +4,7 @@
|
|||
#include <QLabel>
|
||||
#include<QPlainTextEdit>
|
||||
#include<QPushButton>
|
||||
#include<QPushButton>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
|
@ -38,14 +39,38 @@
|
|||
#include "rviz/selection/selection_manager.h"
|
||||
#include "rviz/panel.h"
|
||||
|
||||
#include<QDebug>
|
||||
#include<QKeyEvent>
|
||||
#include <QMutex>
|
||||
#include<QTimer>
|
||||
#include<QObject>
|
||||
#include <QMetaEnum>
|
||||
#include <QRegExp>
|
||||
#include <cmath>
|
||||
#include<QMessageBox>
|
||||
#include<QCoreApplication>
|
||||
#include <QProgressBar>
|
||||
|
||||
#include <rosbag/bag.h>
|
||||
#include <rosbag/view.h>
|
||||
#include <rosbag/query.h>
|
||||
#include<string>
|
||||
#include<QFileDialog>
|
||||
|
||||
#include "rviz/properties/property_tree_widget.h"
|
||||
#include "rviz/selection/selection_manager.h"
|
||||
#include "rviz/panel.h"
|
||||
|
||||
#include "rviz/visualization_manager.h"
|
||||
#include"rviz/tool_manager.h"
|
||||
#include"rviz/tool_manager.h"
|
||||
#include "rviz/render_panel.h"
|
||||
#include "rviz/display.h"
|
||||
|
||||
#include "myviz.h"
|
||||
#include "../tools/color.h"
|
||||
#include "qthread.h"
|
||||
#include "qthread.h"
|
||||
// BEGIN_TUTORIAL
|
||||
// Constructor for MyViz. This does most of the work of the class.
|
||||
MyViz::MyViz( QWidget* parent)
|
||||
|
@ -60,6 +85,7 @@ MyViz::MyViz( QWidget* parent)
|
|||
// 全局变量存放处
|
||||
// 颜色名称,可添加,待设置rgb类型设置颜色
|
||||
color_name = {"white","red","green","black","blue","yellow","pink","purple","skyblue","lightgreen","orange",
|
||||
color_name = {"white","red","green","black","blue","yellow","pink","purple","skyblue","lightgreen","orange",
|
||||
};
|
||||
// 颜色路径名
|
||||
color_icon_filename = QString("../Rviz/librviz_ws/src/librviz_tutorial/sources/images/%1.png");
|
||||
|
@ -341,6 +367,8 @@ MyViz::MyViz( QWidget* parent)
|
|||
// cloud = manager_->createDisplay( "rviz/PointCloud2", "point cloud", true );
|
||||
// ROS_ASSERT( cloud != NULL );
|
||||
|
||||
laser_ = manager_->createDisplay( "rviz/LaserScan", "Qlaser", true );
|
||||
ROS_ASSERT( laser_ );
|
||||
laser_ = manager_->createDisplay( "rviz/LaserScan", "Qlaser", true );
|
||||
ROS_ASSERT( laser_ );
|
||||
// 新增雷达
|
||||
|
@ -397,7 +425,7 @@ void MyViz::Tree_Display(QGridLayout* controls_layout, int index){
|
|||
QTreeWidgetItem *fixed_frame = new QTreeWidgetItem(global, QStringList("Fixed Frame"));
|
||||
|
||||
QLineEdit* fixed_frame_text = new QLineEdit();
|
||||
fixed_frame_text->setText("world");
|
||||
fixed_frame_text->setText("laser");
|
||||
fixed_frame_text->setStyleSheet("background:transparent;border-width:0;border-style:inset");
|
||||
// 初始化固定坐标系
|
||||
cur_fixed_frame = fixed_frame_text->text();
|
||||
|
@ -424,6 +452,9 @@ void MyViz::Tree_Display(QGridLayout* controls_layout, int index){
|
|||
QString color_path = color_icon_filename.arg(color_name[i]);
|
||||
QIcon color_icon(color_path);
|
||||
grid_color_cbox->addItem(color_icon, color_name[i]);
|
||||
QString color_path = color_icon_filename.arg(color_name[i]);
|
||||
QIcon color_icon(color_path);
|
||||
grid_color_cbox->addItem(color_icon, color_name[i]);
|
||||
}
|
||||
connect(grid_color_cbox, SIGNAL(currentIndexChanged(int)), this, SLOT(GridColorChanged(int)));
|
||||
menu->setItemWidget(grid_color, 1, grid_color_cbox);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#define MYVIZ_H
|
||||
|
||||
|
||||
|
||||
#include <QWidget>
|
||||
#include<QString>
|
||||
#include <QGridLayout>
|
||||
|
@ -55,6 +56,8 @@ class RenderPanel;
|
|||
class VisualizationManager;
|
||||
class ToolManager;
|
||||
class PropertyTreeWidget;
|
||||
class ToolManager;
|
||||
class PropertyTreeWidget;
|
||||
}
|
||||
|
||||
// BEGIN_TUTORIAL
|
||||
|
@ -69,6 +72,8 @@ public:
|
|||
void pubThread();
|
||||
void PlayCircle(int index); // 圆圈线程执行函数
|
||||
rosbag::View *view;
|
||||
void PlayCircle(int index); // 圆圈线程执行函数
|
||||
rosbag::View *view;
|
||||
private Q_SLOTS: // QT信号和槽
|
||||
void setThickness( int thickness_percent );
|
||||
void setCellSize( int cell_size_percent );
|
||||
|
@ -83,6 +88,8 @@ private Q_SLOTS: // QT信号和槽
|
|||
void setBackgroundColor(const QString& bg_color); // 背景颜色
|
||||
void AxesDisplayChanged(int index); // axe
|
||||
void CircleDisplayChanged(int index); // circle
|
||||
void AxesDisplayChanged(int index); // axe
|
||||
void CircleDisplayChanged(int index); // circle
|
||||
void Tree_Display(QGridLayout* layout, int index);
|
||||
|
||||
void login_button_clicked();
|
||||
|
@ -99,12 +106,17 @@ private:
|
|||
rviz::VisualizationManager* manager_; //
|
||||
rviz::RenderPanel* render_panel_;
|
||||
rviz::ToolManager* tool_manager_;
|
||||
rviz::ToolManager* tool_manager_;
|
||||
rviz::Display* grid_;
|
||||
rviz::Display* cloud;
|
||||
rviz::Display* laser_;
|
||||
rviz::Display* axes_display;
|
||||
rviz::Display* marker_;
|
||||
rviz::PropertyTreeWidget* tree_widget_ ;
|
||||
rviz::Display* laser_;
|
||||
rviz::Display* axes_display;
|
||||
rviz::Display* marker_;
|
||||
rviz::PropertyTreeWidget* tree_widget_ ;
|
||||
ros::NodeHandle nh;
|
||||
ros::Subscriber sub;
|
||||
ros::Publisher pub;
|
||||
|
|
Loading…
Reference in New Issue