双目立体视觉传感器数据读取与绘图PlotJuggler

Posted Techblog of HaoWANG

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了双目立体视觉传感器数据读取与绘图PlotJuggler相关的知识,希望对你有一定的参考价值。

 

项目地址:GitHub - stereolabs/zed-examples: ZED SDK Example projects

官方文档:Stereolabs Docs: API Reference, Tutorials, and Integration

ROS ZED SDK: Getting IMU and Sensor Data in ROS | Stereolabshttps://www.stereolabs.com/docs/ros/sensor-data/


1. Getting IMU and Sensor Data in ROS

In this tutorial, you will learn how to display ZED cameras sensor data using PlotJuggler and subscribe to the sensors data streams.

Sensor Data visualization with PlotJuggler

In this tutorial, you will learn in detail how to configure the PlotJuggler tool to display data values in multiple dynamic live plots.

The package provides two launch files:

  • plot_sensors_zedm.launch: launches the ZED node preconfigured for the ZED-M and PlotJuggler preconfigured to show ZED-M sensor data
  • plot_sensors_zed2.launch: launches the ZED node preconfigured for the ZED2 and PlotJuggler preconfigured to show ZED2 sensor data
  • plot_sensors_zed2i.launch: launches the ZED node preconfigured for the ZED2i and PlotJuggler preconfigured to show ZED2i sensor data

PlotJuggler · GitHubhttps://github.com/PlotJuggler

GitHub - PlotJuggler/plotjuggler-ros-plugins: Many PlotJuggler plugins for ROS and ROS2.Many PlotJuggler plugins for ROS and ROS2. Contribute to PlotJuggler/plotjuggler-ros-plugins development by creating an account on GitHub.https://github.com/PlotJuggler/plotjuggler-ros-plugins

2.  编译PlotJuggler

ROS plugins for PlotJuggler

PlotJuggler works great with ROS, but it is not itself a "ROS" application.

ROS is supported through external plugins that can be found in this repository.

Existing Plugins

  • DataLoader for rosbags (ROS / ROS2).
  • ROS topic subscriber (ROS / ROS2).
  • Logs/rosout visualizer (ROS only).
  • Re-publisher similar to rosbag play (ROS only).

Install with Debians (TODO)

Install PlotJuggler and its ROS plugins with:

sudo apt install ros-${ROS_DISTRO}-plotjuggler

To launch PlotJuggler on ROS, use the command:

  rosrun plotjuggler plotjuggler

or, if have ROS2 installed:

   ros2 run plotjuggler plotjuggler

How to compile PlotJuggler from source

Create a catkin workspace and clone the repositories:

 mkdir -p ~/ws_plotjuggler/src
 cd ~/ws_plotjuggler/src
 git clone https://github.com/PlotJuggler/plotjuggler_msgs.git
 git clone https://github.com/facontidavide/PlotJuggler.git
 git clone https://github.com/PlotJuggler/plotjuggler-ros-plugins.git

Now, it is time to compile:

cd ~/ws_plotjuggler
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
catkin build

Enjoy:

source devel/setup.bash
roslaunch plotjuggler_ros plotjuggler.launch

3. 使用ZED和PlotJuggler绘制传感器数据

                                                                                                                                                                                                            启动 ZED节点:plot_sensor_zed2.launch             

<?xml version="1.0"?>
<!--
Copyright (c) 2020, STEREOLABS.

All rights reserved.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<launch>
    <arg name="svo_file"             default="" /> <!-- <arg name="svo_file" default="path/to/svo/file.svo"> -->
    <arg name="stream"               default="" /> <!-- <arg name="stream" default="<ip_address>:<port>"> -->

    <arg name="camera_model"         default="zed2" />

    <!-- Launch ZED camera wrapper -->
    <include file="$(find zed_wrapper)/launch/$(arg camera_model).launch">
        <arg name="camera_model"        value="$(arg camera_model)" />
        <arg name="svo_file"            value="$(arg svo_file)" />
        <arg name="stream"              value="$(arg stream)" />
    </include>

    <!-- Launch RQT Plot -->
    <node name="plotjuggler" 
          pkg="plotjuggler" 
          type="plotjuggler" 
          args="-n -l $(find zed_sensors_sub_tutorial)/cfg/$(arg camera_model).xml" 
          output="screen" 
    />

</launch>

 软件使用:

1. 启动plotjuggler节点

2. 订阅ZED传感器节点数据 

 

3. 绘图

 

On the left you can find the list of all the available subscribed topics, on the right the live plots:

  • accelerometer data on the top right
  • gyroscope data on top left
  • orientation in quaternion form on middle left
  • magnetometer data on middle right
  • barometer data on bottom left
  • temperature data on bottom right

以上是关于双目立体视觉传感器数据读取与绘图PlotJuggler的主要内容,如果未能解决你的问题,请参考以下文章

双目立体视觉- ZED2 ROS 双目视觉开发理论与实践 2

双目立体视觉- ZED2 ROS 双目视觉开发理论与实践 2

双目立体视觉

(一) 双目立体视觉介绍

双目立体视觉PyTorch & ZED 3D人体识别与追踪 (下)

双目立体视觉PyTorch & ZED 3D人体识别与追踪 (上)