当前位置:网站首页>Data playback partner rviz+plotjuggler
Data playback partner rviz+plotjuggler
2022-07-02 06:05:00 【Hermit_ Rabbit】
Plotjuggler brief introduction
PlotJuggler Is a similar to rqt_plot Based on the Qt Data visualization tools for . but PlotJuggler Have more powerful and easy-to-use functions . You can import a text file and let it display the data in the text file . You can also import ros Of bag package , It can automatically parse bag Data in the package . And can be played back bag Packet data , And then use Rviz To display data .PlotJuggler There are many functions of , Here are just a few functions I often use . It should be enough to cope with the daily robot development and debugging work .
Plotjuggler Official website :
github Address :
https://github.com/facontidavide/PlotJuggler
install Plotjuggler
Pay attention to the , If it's coordination ROS1 To use , Recommended installation PlotJuggler 2.X.X, If it's coordination ROS2 To use , It is recommended to install PlotJuggler 3.X.X.
Based on binary AppImage Files installed
You can download it directly on the binary file download page .
Download Web page :https://github.com/facontidavide/PlotJuggler/releases

After downloading the file, you need to add execution permission to the file , Then double click to open and use .
ROS Binary installation ( recommend )
Use the following command :
sudo apt install ros-${ROS_DISTRO}-plotjuggler-ros
function Plotjuggler
about ROS1
rosrun plotjuggler plotjuggler
about ROS2
ros2 run plotjuggler plotjuggler
You can also use this command when upgrading a new version
sudo apt-get update
sudo apt install ros-${ROS_DISTRO}-plotjuggler-ros
Source code installation
In this way , You may be right Plotjuggler The code of . There are two cases of source code compilation , And ROS Irrelevant source code compilation and Need and ROS Joint use of source code compilation .
If you pull github The code is slow , Try to use github Download acceleration tools https://ghproxy.com/ .
- And ROS Irrelevant source code compilation
Cloning of warehouse
git clone https://github.com/facontidavide/PlotJuggler.git
Install pre compile dependencies
sudo apt -y install qtbase5-dev libqt5svg5-dev libqt5websockets5-dev libqt5opengl5-dev libqt5x11extras5-dev libprotoc-dev
compiling
mkdir build; cd build
cmake ..
make
sudo make install
Be careful : Compiling in this way is not ROS Related plug-ins .
- Need and ROS Joint use of source code compilation
about ROS1
- Create a workspace and pull the code
mkdir -p ~/ws_plotjuggler/src
cd ~/ws_plotjuggler/src
git clone https://ghproxy.com/https://github.com/PlotJuggler/plotjuggler_msgs.git
git clone https://ghproxy.com/https://github.com/facontidavide/PlotJuggler.git
git clone https://ghproxy.com/https://github.com/PlotJuggler/plotjuggler-ros-plugins.git
- Resolve dependencies and compile
cd ~/ws_plotjuggler
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
catkin_make
- start-up
Plotjuggler
source devel/setup.bash
roslaunch plotjuggler_ros plotjuggler.launch
about ROS2 Galactic
- Create a workspace and pull the code
mkdir -p ~/ws_plotjuggler/src
cd ~/ws_plotjuggler/src
git clone https://ghproxy.com/https://github.com/PlotJuggler/plotjuggler_msgs.git -b ros2
git clone https://ghproxy.com/https://github.com/facontidavide/PlotJuggler.git
git clone https://ghproxy.com/https://github.com/PlotJuggler/plotjuggler-ros-plugins.git -b galactic
- Resolve dependencies and compile
cd ~/ws_plotjuggler
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
colcon build
- start-up
Plotjuggler
source install/setup.bash
ros2 run plotjuggler plotjuggler
use Plotjuggler Show robot path
Save the robot trajectory as CSV file
Use the following example code to store the position of the robot . Other data can be stored in a similar way .
#include <fstream>
#include <ios>
#include <iostream>
#include <string>
#include <vector>
struct Pose
{
double x;
double y;
}
void saveCvsFile(std::string file_name, std::vector<Pose> path)
{
std::ofstream outfile;
outfile.open(file_name.c_str(), std::ios::trunc);
outfile << "x"
<< ","
<< "y"
<< ","
<< "yaw"
<< ","
<< "num" << std::endl;
int num_count = 0;
for (int i = 0; i < path->size(); ++i)
{
outfile << path->at(i).x << "," << path->at(i).y << ","
<< path->at(i).yaw << "," << num_count << std::endl;
num_count++;
}
outfile.close();
}
Plotjuggler Show CSV File path
open Plotjuggler, Choose Data load CSV file .

choice num As x Axis

Show ROS bag Data in
Recording bag The order of
ros2 bag record -o bagname Topic name
Example :
ros2 bag record -o turtlebot /turtle1/cmd_vel /turtle1/pose
Plotguggler load ROS2 bag
Here to load ROS2 Records of the bag For example . about ROS1 bag, The operation process is similar .

ros bag The data in is recorded in chronological order , So in Plotguggler You can drag the progress bar to view the data content at different time points . This function is too convenient for debugging .

subscribe ROS topic of conversation
Click below to start Button to start subscribing to topic data , Click on stop End topic subscription . Then you can see the recorded data at the bottom left .

Plotguggler The playback ROS2 bag,Rviz Display the data
At present, this function is in ROS2 There are still problems in the environment .Plotguggler Of github Relevant have been opened in Issue, But the author doesn't seem to revise it completely . There is still the problem of collapse .Plotguggler 2.x.x The version of is in ROS1 It can be used normally in the environment . Drag the progress bar , The recorded topic data can be played at any rhythm .
Issue website :
边栏推荐
- JWT工具类
- How vite is compatible with lower version browsers
- [leetcode] day92 container with the most water
- PHP obtains some values in the string according to the specified characters, and reorganizes the remaining strings into a new array
- Shenji Bailian 3.52-prim
- Several keywords in C language
- 从设计交付到开发,轻松畅快高效率!
- Picture clipping plug-in cropper js
- Stc8h8k series assembly and C51 actual combat - digital display ADC, key serial port reply key number and ADC value
- Database learning summary 5
猜你喜欢

浏览器原理思维导图

MySQL transaction and isolation level
![[paper translation] gcnet: non local networks meet squeeze exception networks and beyond](/img/7a/718162d08796f70251511101b3a61b.png)
[paper translation] gcnet: non local networks meet squeeze exception networks and beyond

DRM display framework as I understand it

深度学习分类网络 -- AlexNet

51单片机——ADC讲解(A/D转换、D/A转换)

memcached安装

Jetpack Compose 与 Material You 常见问题解答

官方零基础入门 Jetpack Compose 的中文课程来啦!

51 single chip microcomputer - ADC explanation (a/d conversion, d/a conversion)
随机推荐
Happy Lantern Festival | Qiming cloud invites you to guess lantern riddles
Replace Django database with MySQL (attributeerror: 'STR' object has no attribute 'decode')
How to use mitmproxy
Can't the dist packaged by vite be opened directly in the browser
PHP development and testing WebService (soap) -win
mock-用mockjs模拟后台返回数据
[whether PHP has soap extensions installed] a common problem for PHP to implement soap proxy: how to handle class' SoapClient 'not found in PHP
ROS2----LifecycleNode生命周期节点总结
php继承(extends)
Several keywords in C language
STC8H8K系列汇编和C51实战——数码管显示ADC、按键串口回复按键号与ADC数值
外部中断无法进入,删代码再还原就好......记录这个想不到的bug
Go learning notes integration
CNN可视化技术 -- CAM & Grad-CAM详解及pytorch简洁实现
Google Play Academy 组队 PK 赛,正式开赛!
Comment utiliser mitmproxy
Google Go to sea entrepreneurship accelerator registration countdown 3 days, entrepreneurs pass through the guide in advance collection!
Mathematical statistics and machine learning
1035 Password
Unity Shader 学习笔记(3)URP渲染管线带阴影PBR-Shader模板(ASE优化版本)