diff --git a/librviz_tutorial/CHANGELOG.rst b/librviz_tutorial/CHANGELOG.rst old mode 100755 new mode 100644 diff --git a/librviz_tutorial/CMakeLists.txt b/librviz_tutorial/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/librviz_tutorial/launch/rplidar.launch b/librviz_tutorial/launch/rplidar.launch old mode 100755 new mode 100644 diff --git a/librviz_tutorial/package.xml b/librviz_tutorial/package.xml old mode 100755 new mode 100644 diff --git a/librviz_tutorial/rosdoc.yaml b/librviz_tutorial/rosdoc.yaml old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/README.txt b/librviz_tutorial/sdk/README.txt old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/include/rplidar.h b/librviz_tutorial/sdk/include/rplidar.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/include/rplidar_cmd.h b/librviz_tutorial/sdk/include/rplidar_cmd.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/include/rplidar_driver.h b/librviz_tutorial/sdk/include/rplidar_driver.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/include/rplidar_protocol.h b/librviz_tutorial/sdk/include/rplidar_protocol.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/include/rptypes.h b/librviz_tutorial/sdk/include/rptypes.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/linux/arch_linux.h b/librviz_tutorial/sdk/src/arch/linux/arch_linux.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/linux/net_serial.cpp b/librviz_tutorial/sdk/src/arch/linux/net_serial.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/linux/net_serial.h b/librviz_tutorial/sdk/src/arch/linux/net_serial.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/linux/net_socket.cpp b/librviz_tutorial/sdk/src/arch/linux/net_socket.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/linux/thread.hpp b/librviz_tutorial/sdk/src/arch/linux/thread.hpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/linux/timer.cpp b/librviz_tutorial/sdk/src/arch/linux/timer.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/linux/timer.h b/librviz_tutorial/sdk/src/arch/linux/timer.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/macOS/arch_macOS.h b/librviz_tutorial/sdk/src/arch/macOS/arch_macOS.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/macOS/net_serial.cpp b/librviz_tutorial/sdk/src/arch/macOS/net_serial.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/macOS/net_serial.h b/librviz_tutorial/sdk/src/arch/macOS/net_serial.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/macOS/net_socket.cpp b/librviz_tutorial/sdk/src/arch/macOS/net_socket.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/macOS/thread.hpp b/librviz_tutorial/sdk/src/arch/macOS/thread.hpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/macOS/timer.cpp b/librviz_tutorial/sdk/src/arch/macOS/timer.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/macOS/timer.h b/librviz_tutorial/sdk/src/arch/macOS/timer.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/win32/arch_win32.h b/librviz_tutorial/sdk/src/arch/win32/arch_win32.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/win32/net_serial.cpp b/librviz_tutorial/sdk/src/arch/win32/net_serial.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/win32/net_serial.h b/librviz_tutorial/sdk/src/arch/win32/net_serial.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/win32/net_socket.cpp b/librviz_tutorial/sdk/src/arch/win32/net_socket.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/win32/timer.cpp b/librviz_tutorial/sdk/src/arch/win32/timer.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/win32/timer.h b/librviz_tutorial/sdk/src/arch/win32/timer.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/arch/win32/winthread.hpp b/librviz_tutorial/sdk/src/arch/win32/winthread.hpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/abs_rxtx.h b/librviz_tutorial/sdk/src/hal/abs_rxtx.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/assert.h b/librviz_tutorial/sdk/src/hal/assert.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/byteops.h b/librviz_tutorial/sdk/src/hal/byteops.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/event.h b/librviz_tutorial/sdk/src/hal/event.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/locker.h b/librviz_tutorial/sdk/src/hal/locker.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/socket.h b/librviz_tutorial/sdk/src/hal/socket.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/thread.cpp b/librviz_tutorial/sdk/src/hal/thread.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/thread.h b/librviz_tutorial/sdk/src/hal/thread.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/types.h b/librviz_tutorial/sdk/src/hal/types.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/hal/util.h b/librviz_tutorial/sdk/src/hal/util.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/rplidar_driver.cpp b/librviz_tutorial/sdk/src/rplidar_driver.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/rplidar_driver_TCP.h b/librviz_tutorial/sdk/src/rplidar_driver_TCP.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/rplidar_driver_impl.h b/librviz_tutorial/sdk/src/rplidar_driver_impl.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/rplidar_driver_serial.h b/librviz_tutorial/sdk/src/rplidar_driver_serial.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/sdk/src/sdkcommon.h b/librviz_tutorial/sdk/src/sdkcommon.h old mode 100755 new mode 100644 diff --git a/librviz_tutorial/src/doc/conf.py b/librviz_tutorial/src/doc/conf.py old mode 100755 new mode 100644 diff --git a/librviz_tutorial/src/doc/index.rst b/librviz_tutorial/src/doc/index.rst old mode 100755 new mode 100644 diff --git a/librviz_tutorial/src/doc/myviz.png b/librviz_tutorial/src/doc/myviz.png old mode 100755 new mode 100644 diff --git a/librviz_tutorial/src/doc/tutorialformatter.py b/librviz_tutorial/src/doc/tutorialformatter.py old mode 100755 new mode 100644 diff --git a/librviz_tutorial/src/main.cpp b/librviz_tutorial/src/main.cpp old mode 100755 new mode 100644 diff --git a/librviz_tutorial/src/myviz.cpp b/librviz_tutorial/src/myviz.cpp old mode 100755 new mode 100644 index 3e9b2a5..888b65b --- a/librviz_tutorial/src/myviz.cpp +++ b/librviz_tutorial/src/myviz.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -38,14 +39,38 @@ #include "rviz/selection/selection_manager.h" #include "rviz/panel.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#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); diff --git a/librviz_tutorial/src/myviz.h b/librviz_tutorial/src/myviz.h old mode 100755 new mode 100644 index 1779b7d..eeaa1eb --- a/librviz_tutorial/src/myviz.h +++ b/librviz_tutorial/src/myviz.h @@ -30,6 +30,7 @@ #define MYVIZ_H + #include #include #include @@ -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; diff --git a/librviz_tutorial/src/node.cpp b/librviz_tutorial/src/node.cpp old mode 100755 new mode 100644