Merge remote-tracking branch 'origin/master' into online_version

pull/1/head
wubw1656 2023-10-07 16:43:21 +08:00
commit 86d0b5519f
55 changed files with 44 additions and 1 deletions

0
librviz_tutorial/CHANGELOG.rst Executable file → Normal file
View File

0
librviz_tutorial/CMakeLists.txt Executable file → Normal file
View File

0
librviz_tutorial/launch/rplidar.launch Executable file → Normal file
View File

0
librviz_tutorial/package.xml Executable file → Normal file
View File

0
librviz_tutorial/rosdoc.yaml Executable file → Normal file
View File

0
librviz_tutorial/sdk/README.txt Executable file → Normal file
View File

0
librviz_tutorial/sdk/include/rplidar.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/include/rplidar_cmd.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/include/rplidar_driver.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/include/rplidar_protocol.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/include/rptypes.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/linux/arch_linux.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/linux/net_serial.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/linux/net_serial.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/linux/net_socket.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/linux/thread.hpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/linux/timer.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/linux/timer.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/macOS/arch_macOS.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/macOS/net_serial.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/macOS/net_serial.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/macOS/net_socket.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/macOS/thread.hpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/macOS/timer.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/macOS/timer.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/win32/arch_win32.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/win32/net_serial.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/win32/net_serial.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/win32/net_socket.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/win32/timer.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/win32/timer.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/arch/win32/winthread.hpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/abs_rxtx.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/assert.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/byteops.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/event.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/locker.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/socket.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/thread.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/thread.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/types.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/hal/util.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/rplidar_driver.cpp Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/rplidar_driver_TCP.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/rplidar_driver_impl.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/rplidar_driver_serial.h Executable file → Normal file
View File

0
librviz_tutorial/sdk/src/sdkcommon.h Executable file → Normal file
View File

0
librviz_tutorial/src/doc/conf.py Executable file → Normal file
View File

0
librviz_tutorial/src/doc/index.rst Executable file → Normal file
View File

0
librviz_tutorial/src/doc/myviz.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
librviz_tutorial/src/doc/tutorialformatter.py Executable file → Normal file
View File

0
librviz_tutorial/src/main.cpp Executable file → Normal file
View File

33
librviz_tutorial/src/myviz.cpp Executable file → Normal file
View File

@ -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);

12
librviz_tutorial/src/myviz.h Executable file → Normal file
View File

@ -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;

0
librviz_tutorial/src/node.cpp Executable file → Normal file
View File