rviz_visual_tools package from rviz_visual_tools repo

rviz_visual_tools

Package Summary

Tags No category tags.
Version 3.0.0
License BSD
Buildtool CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/davetcoleman/rviz_visual_tools.git
VCS Type git
VCS Version kinetic-devel
Last Updated 2016-06-29
Dev Status DEVELOPED
Released UNRELEASED

Package Description

Helper functions for displaying and debugging data in Rviz via published markers

Additional Links

Maintainers

  • Dave Coleman
  • Andy McEvoy

Authors

  • Dave Coleman
README

Rviz Visual Tools

C++ API wrapper for displaying shapes and meshes in Rviz via helper functions that publish markers. Useful for displaying and debugging data. For more advanced robot visualization features, see the moveit_visual_tools which builds on this class, or ompl_visual_tools if you are an OMPL ROS user.

This package includes:

  • Easy to use helper functions for visualizing in Rviz fast
  • Basic geometric markers for Rviz
  • More complex geometric shapes such as coordinate frames, framed boxes, planes, paths, graphs
  • Ability to quickly choose standard colors and sizes
  • Tools to ensure proper connection to Rviz before publishing visualizations
  • Shortcuts to convert between different types of points and poses - ROS msgs, Eigen, tf, etc
  • Batch publishing capabilities to reduce over throttling ROS messages
  • A tf publishing helper class

Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.

  • Build Status Travis CI
  • Build Status ROS Buildfarm - Trusty Devel Source Build
  • Build Status ROS Buildfarm - AMD64 Trusty Debian Build

Install

Ubuntu Debian

sudo apt-get install ros-kinetic-rviz-visual-tools

Build from Source

Clone this repository into a catkin workspace, then use the rosdep install tool to automatically download its dependencies. Depending on your current version of ROS, use:

rosdep install --from-paths src --ignore-src --rosdistro kinetic

Quick Start Demo

To see random shapes generated in Rviz, first launch Rviz:

roslaunch rviz_visual_tools demo_rviz.launch

Then start demo:

roslaunch rviz_visual_tools demo.launch

Code API

See the Doxygen documentation

Usage

We'll assume you will be using these helper functions within a class. Almost all of the functions assume you are publishing transforms in the world frame (whatever you call that e.g. /odom).

Initialize

Add to your includes:

#include <rviz_visual_tools/rviz_visual_tools.h>

Add to your class's member variables:

// For visualizing things in rviz
rviz_visual_tools::RvizVisualToolsPtr visual_tools_;

In your class' constructor add:

visual_tools_.reset(new rviz_visual_tools::RvizVisualTools("base_frame","/rviz_visual_markers"));

Change the first parameter to the name of your robot's base frame, and the second parameter to whatever name you'd like to use for the corresponding Rviz marker ROS topic.

Tools

Now in your code you can easily debug your code using visual markers in Rviz

Start rviz and create a new marker using the 'Add' button at the bottom right. Choose the marker topic to be the same as the topic you specified in the constructor.

Example Code

In the following snippet we create a pose at xyz (0.1, 0.1, 0.1) and rotate the pose down 45 degrees along the Y axis. Then we publish the pose as a arrow for visualziation in Rviz. Make sure your Rviz fixed frame is the same as the one chosen in the code.

// Create pose
Eigen::Affine3d pose;
pose = Eigen::AngleAxisd(M_PI/4, Eigen::Vector3d::UnitY()); // rotate along X axis by 45 degrees
pose.translation() = Eigen::Vector3d( 0.1, 0.1, 0.1 ); // translate x,y,z

// Publish arrow vector of pose
ROS_INFO_STREAM_NAMED("test","Publishing Arrow");
visual_tools_->publishArrow(pose, rviz_visual_tools::RED, rviz_visual_tools::LARGE);

Basic Publishing Functions

See visual_tools.h for more details and documentation on the following functions:

  • publishSphere
  • publishSpheres
  • publishArrow/publishXArrow
  • publishYArrow
  • publishZArrow
  • publishCuboid
  • publishCone
  • publishXYPlane
  • publishXZPlane
  • publishYZPlane
  • publishLine
  • publishPath
  • publishPolygon
  • publishBlock
  • publishWireframeCuboid
  • publishWireframeRectangle
  • publishAxis
  • publishAxisLabeled
  • publishCylinder
  • publishMesh
  • publishMesh
  • publishText
  • publishTest

And more...

Helper Functions

Reset function

  • deleteAllMarkers - tells Rviz to clear out all current markers from being displayed.

Batch publish - useful for when many markers need to be published at once to prevent buffer overflow of ROS messages.

  • enableBatchPublishing()
  • triggerBatchPublish()
  • triggerBatchPublishAndDisable()

Conversion functions

  • convertPose
  • convertPoint32ToPose
  • convertPoseToPoint
  • convertPoint
  • convertPoint32
  • convertFromXYZRPY
  • convertToXYZRPY

Convenience functions

  • generateRandomPose
  • generateEmptyPose
  • dRand
  • fRand
  • iRand
  • getCenterPoint
  • getVectorBetweenPoints

Available Colors

This package helps you quickly choose colors - feel free to send PRs with more colors as needed

BLACK,
BLUE,
BROWN,
CYAN,
DARK_GREY,
GREEN,
GREY,
LIME_GREEN,
MAGENTA,
ORANGE,
PINK,
PURPLE,
RED,
WHITE,
YELLOW,
TRANSLUCENT_LIGHT,
TRANSLUCENT,
TRANSLUCENT_DARK,
RAND,
CLEAR,
DEFAULT // i.e. 'do not change default color'

Available Marker Sizes

XXSMALL,
XSMALL,
SMALL,
REGULAR,
LARGE,
xLARGE,
xxLARGE,
xxxLARGE,
XLARGE,
XXLARGE

Batch Publishing

There is a new feature that allows markers to be saved up in an array until a trigger is recieved to send all markers to Rviz for visualization. This is useful when many markers need to be published at once that can overflow the Rviz message buffers. To enable, use enableBatchPublishing(true) and to trigger use `triggerBatchPublish().

TF Visual Tools

This tool lets you easily debug Eigen transforms in Rviz. Demo use:

rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Affine3d world_to_shelf_transform = Eigen::Affine3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");

Testing and Linting

To run roslint, use the following command with catkin-tools:

catkin build --no-status --no-deps --this --make-args roslint

To run catkin lint, use the following command with catkin-tools:

catkin lint -W2

Use the following command with catkin-tools to run the small amount of available tests:

catkin run_tests --no-deps --this -i

Contribute

Please send PRs for new helper functions, fixes, etc!

CHANGELOG

Changelog for package rviz_visual_tools

3.0.0 (2016-06-29)

  • Improve Travis script
  • Upgrade to Eigen3 per ROS Kinetic requirements
  • New screenshot
  • Refactored entire scaling method - all sizes of shapes have been affected
  • Renamed scales
  • Removed const reference for primitive types in function headers
  • Cleaned up getScale() function
  • New publishSpheres function
  • Two new tests & screenshot
  • Deprecated size REGULAR
  • Number scale sizes
  • New intToRvizScale() function
  • New publishSpheres() functions for showing list of lines AND colors
  • New publishLines() functions for using LINE_LIST
  • New publishCylinder() function that uses scales
  • Bug fix for getVectorBetweenPoints() when vector is all zeros
  • New printTranslation() function
  • added intToRvizColor() for interfaces that do not directly depend on Rviz Visual Tools, such as OMPL
  • publishPath with vector of colors
  • Update demo
  • New variant of publishPath with vector of colors
  • New publishSphere() helper
  • Add eigen_stl_containers
  • Add missing breaks in switch statement
  • Add namespace to ease debugging ROS messages
  • Do not pass Eigen structures by value
  • Fix all vector<Eigen> to EigenSTL::vector_Vector3d as recommended by @VictorLamoine
  • Hide upstream package cast warning
  • Overload new operator for Eigen structures
  • Changing the angles will change the opening angle of the cone
  • Better way to turn on C++11, maybe?
  • Removed deprecated code for Kinetic
  • Began converting to C++11
  • Fix dead link to the documentation
  • New waitForMarkerPub() function
  • Fix bug in waitForSubscriber() introduced in previous commit
  • Added blocking constraint option in function waitForSubscriber
  • New publishLine() variant
  • ID for publishing rectangles
  • Optimize clearing and resizing vectors
  • Increase random color sampling attempts
  • Move variable declaration
  • Latched publisher
  • publishAxisLabeled arguments
  • Include path, boost typedef and class name are now up to date with the code.
  • New publishLine() variant
  • Optional latched publisher
  • ID for publishing rectangles
  • Optimize clearing and resizing vectors
  • Increase random color sampling attempts
  • Move variable declaration
  • publishAxisLabeled arguments order
  • Adds Publish Labeled Axis
  • Contributors: Abhijit Makhal, Dave Coleman, Naveed Usmani, Sow Papa Libasse, Victor Lamoine

2.2.0 (2016-04-28)

  • Created much better demo, added new screenshot
  • Numbered colors so that they can be matched in OMPL
  • New publishLine() function variants
  • Psychedelic mode
  • Prevent publishing empty marker arrays
  • Improved warning and error correction
  • New publishSphere function
  • Ability to set marker topic after constructor
  • Ability to force waiting for topic to connect
  • Added new posesEqual() function
  • Updated publishArrow() function
  • New publishPath function
  • New publishLine function
  • New publishCylinder that accepts two points
  • New publishText function
  • Removed redundant namespace names
  • New convertPointToPose function
  • Reduced output
  • Renamed line_marker_ to line_strip_marker_
  • Faster method for waiting for subscriber thread
  • Untested publishPath() modification
  • Fix to correctly use optional alpha color property
  • Change getColorScale to work from 0->1 instead of 0->100
  • Additional parameters to publishCuboid()
  • New color scale function for generated interpolated colors from RED->GREEN (1->100)
  • Contributors: Dave Coleman

2.1.0 (2016-02-09)

  • Allow publishArrow functions to specify ID
  • Contributors: Dave Coleman

2.0.3 (2016-01-10)

  • Renamed test to demo
  • Fix bug in random number generator
  • Noted a TODO
  • Documentation
  • Contributors: Dave Coleman

2.0.2 (2015-12-27)

  • Formatting
  • Removed unused var
  • roslint fixes
  • Contributors: Dave Coleman

2.0.1 (2015-12-05)

  • catkin lint cleanup
  • Updated travis badge
  • Updated README
  • Contributors: Dave Coleman

2.0.0 (2015-12-02)

  • Updated README
  • Add badges
  • Default true for enableBatchPublishing()
  • Renamed convertXYZRPY() to convertFromXYZRPY()
  • Changed roll pitch yall convention (fix)
  • Added preliminary unit tests
  • Hide include dependencies
  • New convertToXYZRPY function
  • Decrease wait time for topics to subscribe
  • New publishSphere and publishArrow functions
  • Added new thread safe pose conversion function
  • Auto format with clang
  • New publishSphere with frame_id function
  • New print transform functions
  • Fixed RPY error
  • New convert Affine3d to roll pitch yaw function
  • New tf_visual_tools functionality to help debug transforms
  • New parameter server isEnabled feature
  • Add id for wireframe cuboids
  • Namespaced publishWireframeCuboid
  • Helper function for publishAxisLabeled
  • New getBoolMap() function
  • New convertXYZRPY() function
  • Fix warnings
  • Fixed yellow
  • Fix internal publish bug
  • Check for empty parameter
  • New delayed publishing internal mode
  • added publishCuboid function for Eigen::Affine3d
  • New string vector param reading
  • added publishCuboid function for Eigen::Affine3d
  • Show whole param path
  • Added publish plane and cone
  • Renamed to publishAxisLabled()
  • New publishWireframeRectangle function
  • Fixed publishZArrow direction
  • New publishAxisWithLabel() function
  • Removed mute functionality
  • New publishWireframeRectangle() function
  • Improved memory reuse by utilizing member variables for conversion functions
  • Fixed ordering of functions in file
  • Added alpha values to fix planning scene visualization
  • Add WireframCuboid function to show oriented bounding boxes as computed ...
  • Made more function parameters passed by reference
  • Add color to wireframe
  • Add WireframCuboid function to show oriented bounding boxes as computed from PCL.
  • New generateRandomCuboid() function
  • Fixed formatting, added a PoseStamped version to publish[X|Y|Z]Arrow() functions
  • publishMesh() now has optional ID specification
  • Fixed generateRandomPose() bug
  • Added Eigen version of generateRandomPose()
  • changed floats to double in random pose struct, added publish block function to take pose
  • Updated rviz_visual_tools API
  • Deprecated publishRectangle() in favor of publishCuboid()
  • Added cyan and magenta
  • Added maintainer
  • Removed random pose bounds member variable in favor of using a funciton parameter
  • Added publish arrow functions
  • Added dark grey color
  • New publishLine function takes two Vector3's
  • added functionality to change bounds of random pose
  • New publishArrow function that allows stamped pose for arbitrary parent frames
  • added ArrayXXf to hold bounds on random pose
  • new publishLine function takes two Vector3's
  • Made yellow brighter
  • added marker array to rviz and modified generate random pose to give actual random pose
  • New publishArrow() functions
  • New batch publishing method - allows markers to be published in batches to reduce ROS messages being published
  • added method for displaying cuboids
  • added a clear overlay
  • New publishMesh function
  • Added Brown, Pink, and Lime Green colors
  • Copyright year
  • Contributors: Dave Coleman, Andy McEvoy, Jorge Ca

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

rviz_visual_tools package from rviz_visual_tools repo

rviz_visual_tools

Package Summary

Tags No category tags.
Version 2.2.0
License BSD
Buildtool CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/davetcoleman/rviz_visual_tools.git
VCS Type git
VCS Version jade-devel
Last Updated 2016-06-15
Dev Status DEVELOPED
Released RELEASED

Package Description

Helper functions for displaying and debugging data in Rviz via published markers

Additional Links

Maintainers

  • Dave Coleman
  • Andy McEvoy

Authors

  • Dave Coleman
README

Rviz Visual Tools

C++ API wrapper for displaying shapes and meshes in Rviz via helper functions that publish markers. Useful for displaying and debugging data. For more advanced robot visualization features, see the moveit_visual_tools which builds on this class, or ompl_visual_tools if you are an OMPL ROS user.

This package includes:

  • Easy to use helper functions for visualizing in Rviz fast
  • Basic geometric markers for Rviz
  • More complex geometric shapes such as coordinate frames, framed boxes, planes, paths, graphs
  • Ability to quickly choose standard colors and sizes
  • Tools to ensure proper connection to Rviz before publishing visualizations
  • Shortcuts to convert between different types of points and poses - ROS msgs, Eigen, tf, etc
  • Batch publishing capabilities to reduce over throttling ROS messages
  • A tf publishing helper class

Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.

  • Build Status Travis CI
  • Build Status ROS Buildfarm - Trusty Devel Source Build
  • Build Status ROS Buildfarm - AMD64 Trusty Debian Build

Install

Ubuntu Debian

sudo apt-get install ros-jade-rviz-visual-tools

Build from Source

Clone this repository into a catkin workspace, then use the rosdep install tool to automatically download its dependencies. Depending on your current version of ROS, use:

rosdep install --from-paths src --ignore-src --rosdistro jade

Quick Start Demo

To see random shapes generated in Rviz, first launch Rviz:

roslaunch rviz_visual_tools demo_rviz.launch

Then start demo:

roslaunch rviz_visual_tools demo.launch

Code API

See the Doxygen documentation

Usage

We'll assume you will be using these helper functions within a class. Almost all of the functions assume you are publishing transforms in the world frame (whatever you call that e.g. /odom).

Initialize

Add to your includes:

#include <rviz_visual_tools/rviz_visual_tools.h>

Add to your class's member variables:

// For visualizing things in rviz
rviz_visual_tools::RvizVisualToolsPtr visual_tools_;

In your class' constructor add:

visual_tools_.reset(new rviz_visual_tools::RvizVisualTools("base_frame","/rviz_visual_markers"));

Change the first parameter to the name of your robot's base frame, and the second parameter to whatever name you'd like to use for the corresponding Rviz marker ROS topic.

Tools

Now in your code you can easily debug your code using visual markers in Rviz

Start rviz and create a new marker using the 'Add' button at the bottom right. Choose the marker topic to be the same as the topic you specified in the constructor.

Example Code

In the following snippet we create a pose at xyz (0.1, 0.1, 0.1) and rotate the pose down 45 degrees along the Y axis. Then we publish the pose as a arrow for visualziation in Rviz. Make sure your Rviz fixed frame is the same as the one chosen in the code.

// Create pose
Eigen::Affine3d pose;
pose = Eigen::AngleAxisd(M_PI/4, Eigen::Vector3d::UnitY()); // rotate along X axis by 45 degrees
pose.translation() = Eigen::Vector3d( 0.1, 0.1, 0.1 ); // translate x,y,z

// Publish arrow vector of pose
ROS_INFO_STREAM_NAMED("test","Publishing Arrow");
visual_tools_->publishArrow(pose, rviz_visual_tools::RED, rviz_visual_tools::LARGE);

Basic Publishing Functions

See visual_tools.h for more details and documentation on the following functions:

  • publishSphere
  • publishSpheres
  • publishArrow/publishXArrow
  • publishYArrow
  • publishZArrow
  • publishCuboid
  • publishCone
  • publishXYPlane
  • publishXZPlane
  • publishYZPlane
  • publishLine
  • publishPath
  • publishPolygon
  • publishBlock
  • publishWireframeCuboid
  • publishWireframeRectangle
  • publishAxis
  • publishAxisLabeled
  • publishCylinder
  • publishMesh
  • publishMesh
  • publishText
  • publishTest

And more...

Helper Functions

Reset function

  • deleteAllMarkers - tells Rviz to clear out all current markers from being displayed.

Batch publish - useful for when many markers need to be published at once to prevent buffer overflow of ROS messages.

  • enableBatchPublishing()
  • triggerBatchPublish()
  • triggerBatchPublishAndDisable()

Conversion functions

  • convertPose
  • convertPoint32ToPose
  • convertPoseToPoint
  • convertPoint
  • convertPoint32
  • convertFromXYZRPY
  • convertToXYZRPY

Convenience functions

  • generateRandomPose
  • generateEmptyPose
  • dRand
  • fRand
  • iRand
  • getCenterPoint
  • getVectorBetweenPoints

Available Colors

This package helps you quickly choose colors - feel free to send PRs with more colors as needed

BLACK,
BLUE,
BROWN,
CYAN,
DARK_GREY,
GREEN,
GREY,
LIME_GREEN,
MAGENTA,
ORANGE,
PINK,
PURPLE,
RED,
WHITE,
YELLOW,
TRANSLUCENT_LIGHT,
TRANSLUCENT,
TRANSLUCENT_DARK,
RAND,
CLEAR,
DEFAULT // i.e. 'do not change default color'

Available Marker Sizes

XXSMALL,
XSMALL,
SMALL,
REGULAR,
LARGE,
xLARGE,
xxLARGE,
xxxLARGE,
XLARGE,
XXLARGE

Batch Publishing

There is a new feature that allows markers to be saved up in an array until a trigger is recieved to send all markers to Rviz for visualization. This is useful when many markers need to be published at once that can overflow the Rviz message buffers. To enable, use enableBatchPublishing(true) and to trigger use `triggerBatchPublish().

TF Visual Tools

This tool lets you easily debug Eigen transforms in Rviz. Demo use:

rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Affine3d world_to_shelf_transform = Eigen::Affine3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");

Testing and Linting

To run roslint, use the following command with catkin-tools:

catkin build --no-status --no-deps --this --make-args roslint

To run catkin lint, use the following command with catkin-tools:

catkin lint -W2

Use the following command with catkin-tools to run the small amount of available tests:

catkin run_tests --no-deps --this -i

Contribute

Please send PRs for new helper functions, fixes, etc!

CHANGELOG

Changelog for package rviz_visual_tools

2.2.0 (2016-04-28)

  • Created much better demo, added new screenshot
  • Numbered colors so that they can be matched in OMPL
  • New publishLine() function variants
  • Psychedelic mode
  • Prevent publishing empty marker arrays
  • Improved warning and error correction
  • New publishSphere function
  • Ability to set marker topic after constructor
  • Ability to force waiting for topic to connect
  • Added new posesEqual() function
  • Updated publishArrow() function
  • New publishPath function
  • New publishLine function
  • New publishCylinder that accepts two points
  • New publishText function
  • Removed redundant namespace names
  • New convertPointToPose function
  • Reduced output
  • Renamed line_marker_ to line_strip_marker_
  • Faster method for waiting for subscriber thread
  • Untested publishPath() modification
  • Fix to correctly use optional alpha color property
  • Change getColorScale to work from 0->1 instead of 0->100
  • Additional parameters to publishCuboid()
  • New color scale function for generated interpolated colors from RED->GREEN (1->100)
  • Contributors: Dave Coleman

2.1.0 (2016-02-09)

  • Allow publishArrow functions to specify ID
  • Contributors: Dave Coleman

2.0.3 (2016-01-10)

  • Renamed test to demo
  • Fix bug in random number generator
  • Noted a TODO
  • Documentation
  • Contributors: Dave Coleman

2.0.2 (2015-12-27)

  • Formatting
  • Removed unused var
  • roslint fixes
  • Contributors: Dave Coleman

2.0.1 (2015-12-05)

  • catkin lint cleanup
  • Updated travis badge
  • Updated README
  • Contributors: Dave Coleman

2.0.0 (2015-12-02)

  • Updated README
  • Add badges
  • Default true for enableBatchPublishing()
  • Renamed convertXYZRPY() to convertFromXYZRPY()
  • Changed roll pitch yall convention (fix)
  • Added preliminary unit tests
  • Hide include dependencies
  • New convertToXYZRPY function
  • Decrease wait time for topics to subscribe
  • New publishSphere and publishArrow functions
  • Added new thread safe pose conversion function
  • Auto format with clang
  • New publishSphere with frame_id function
  • New print transform functions
  • Fixed RPY error
  • New convert Affine3d to roll pitch yaw function
  • New tf_visual_tools functionality to help debug transforms
  • New parameter server isEnabled feature
  • Add id for wireframe cuboids
  • Namespaced publishWireframeCuboid
  • Helper function for publishAxisLabeled
  • New getBoolMap() function
  • New convertXYZRPY() function
  • Fix warnings
  • Fixed yellow
  • Fix internal publish bug
  • Check for empty parameter
  • New delayed publishing internal mode
  • added publishCuboid function for Eigen::Affine3d
  • New string vector param reading
  • added publishCuboid function for Eigen::Affine3d
  • Show whole param path
  • Added publish plane and cone
  • Renamed to publishAxisLabled()
  • New publishWireframeRectangle function
  • Fixed publishZArrow direction
  • New publishAxisWithLabel() function
  • Removed mute functionality
  • New publishWireframeRectangle() function
  • Improved memory reuse by utilizing member variables for conversion functions
  • Fixed ordering of functions in file
  • Added alpha values to fix planning scene visualization
  • Add WireframCuboid function to show oriented bounding boxes as computed ...
  • Made more function parameters passed by reference
  • Add color to wireframe
  • Add WireframCuboid function to show oriented bounding boxes as computed from PCL.
  • New generateRandomCuboid() function
  • Fixed formatting, added a PoseStamped version to publish[X|Y|Z]Arrow() functions
  • publishMesh() now has optional ID specification
  • Fixed generateRandomPose() bug
  • Added Eigen version of generateRandomPose()
  • changed floats to double in random pose struct, added publish block function to take pose
  • Updated rviz_visual_tools API
  • Deprecated publishRectangle() in favor of publishCuboid()
  • Added cyan and magenta
  • Added maintainer
  • Removed random pose bounds member variable in favor of using a funciton parameter
  • Added publish arrow functions
  • Added dark grey color
  • New publishLine function takes two Vector3's
  • added functionality to change bounds of random pose
  • New publishArrow function that allows stamped pose for arbitrary parent frames
  • added ArrayXXf to hold bounds on random pose
  • new publishLine function takes two Vector3's
  • Made yellow brighter
  • added marker array to rviz and modified generate random pose to give actual random pose
  • New publishArrow() functions
  • New batch publishing method - allows markers to be published in batches to reduce ROS messages being published
  • added method for displaying cuboids
  • added a clear overlay
  • New publishMesh function
  • Added Brown, Pink, and Lime Green colors
  • Copyright year
  • Contributors: Dave Coleman, Andy McEvoy, Jorge Ca

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

rviz_visual_tools package from rviz_visual_tools repo

rviz_visual_tools

Package Summary

Tags No category tags.
Version 2.1.0
License BSD
Buildtool CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/davetcoleman/rviz_visual_tools.git
VCS Type git
VCS Version indigo-devel
Last Updated 2016-06-14
Dev Status DEVELOPED
Released RELEASED

Package Description

Helper functions for displaying and debugging data in Rviz via published markers

Additional Links

Maintainers

  • Dave Coleman
  • Andy McEvoy

Authors

  • Dave Coleman
README

Rviz Visual Tools

Helper functions for displaying and debugging data in Rviz via published markers.

This package includes:

  • Basic geometric markers for Rviz
  • A tf publishing helper class

Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and others.

  • Build Status Travis CI
  • Build Status ROS Buildfarm - Trusty Devel Source Build
  • Build Status ROS Buildfarm - AMD64 Trusty Debian Build

Install

Ubuntu Debian

sudo apt-get install ros-indigo-rviz-visual-tools

Build from Source

Clone this repository into a catkin workspace, then use the rosdep install tool to automatically download its dependencies. Depending on your current version of ROS, use:

rosdep install --from-paths src --ignore-src --rosdistro indigo

Quick Start Demo

To see random shapes generated in Rviz, first launch Rviz:

roslaunch rviz_visual_tools demo_rviz.launch

Then start demo:

roslaunch rviz_visual_tools demo.launch

Code API

See VisualTools Class Reference

Usage

We'll assume you will be using these helper functions within a class. Almost all of the functions assume you are publishing transforms in the world frame (whatever you call that e.g. /odom).

Initialize

Add to your includes:

#include <rviz_visual_tools/visual_tools.h>

Add to your class's member variables:

// For visualizing things in rviz
rviz_visual_tools::VisualToolsPtr visual_tools_;

In your class' constructor add:

visual_tools_.reset(new rviz_visual_tools::VisualTools("base_frame","/rviz_visual_markers"));

Change the first parameter to the name of your robot's base frame, and the second parameter to whatever name you'd like to use for the corresponding Rviz marker ROS topic.

Tools

Now in your code you can easily debug your code using visual markers in Rviz

Start rviz and create a new marker using the 'Add' button at the bottom right. Choose the marker topic to be the same as the topic you specified in the constructor.

Example Code

In the following snippet we create a pose at xyz (0.1, 0.1, 0.1) and rotate the pose down 45 degrees along the Y axis. Then we publish the pose as a arrow for visualziation in Rviz. Make sure your Rviz fixed frame is the same as the one chosen in the code.

// Create pose
Eigen::Affine3d pose;
pose = Eigen::AngleAxisd(M_PI/4, Eigen::Vector3d::UnitY()); // rotate along X axis by 45 degrees
pose.translation() = Eigen::Vector3d( 0.1, 0.1, 0.1 ); // translate x,y,z

// Publish arrow vector of pose
ROS_INFO_STREAM_NAMED("test","Publishing Arrow");
visual_tools_->publishArrow(pose, rviz_visual_tools::RED, rviz_visual_tools::LARGE);

Basic Publishing Functions

See visual_tools.h for more details and documentation on the following functions:

  • publishSphere
  • publishSpheres
  • publishArrow/publishXArrow
  • publishYArrow
  • publishZArrow
  • publishCuboid
  • publishCone
  • publishXYPlane
  • publishXZPlane
  • publishYZPlane
  • publishLine
  • publishPath
  • publishPolygon
  • publishBlock
  • publishWireframeCuboid
  • publishWireframeRectangle
  • publishAxis
  • publishAxisLabeled
  • publishCylinder
  • publishMesh
  • publishMesh
  • publishText
  • publishTest

And more...

Helper Functions

Reset function

  • deleteAllMarkers - tells Rviz to clear out all current markers from being displayed.

Batch publish - useful for when many markers need to be published at once to prevent buffer overflow of ROS messages.

  • enableBatchPublishing()
  • triggerBatchPublish()
  • triggerBatchPublishAndDisable()

Conversion functions

  • convertPose
  • convertPoint32ToPose
  • convertPoseToPoint
  • convertPoint
  • convertPoint32
  • convertFromXYZRPY
  • convertToXYZRPY

Convenience functions

  • generateRandomPose
  • generateEmptyPose
  • dRand
  • fRand
  • iRand
  • getCenterPoint
  • getVectorBetweenPoints

Available Colors

This package helps you quickly choose colors - feel free to send PRs with more colors as needed

BLACK,
BLUE,
BROWN,
CYAN,
DARK_GREY,
GREEN,
GREY,
LIME_GREEN,
MAGENTA,
ORANGE,
PINK,
PURPLE,
RED,
WHITE,
YELLOW,
TRANSLUCENT_LIGHT,
TRANSLUCENT,
TRANSLUCENT_DARK,
RAND,
CLEAR,
DEFAULT // i.e. 'do not change default color'

Available Marker Sizes

XXSMALL,
XSMALL,
SMALL,
REGULAR,
LARGE,
xLARGE,
xxLARGE,
xxxLARGE,
XLARGE,
XXLARGE

Batch Publishing

There is a new feature that allows markers to be saved up in an array until a trigger is recieved to send all markers to Rviz for visualization. This is useful when many markers need to be published at once that can overflow the Rviz message buffers. To enable, use enableBatchPublishing(true) and to trigger use `triggerBatchPublish().

TF Visual Tools

This tool lets you easily debug Eigen transforms in Rviz. Demo use:

rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Affine3d world_to_shelf_transform = Eigen::Affine3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");

Testing and Linting

To run roslint, use the following command with catkin-tools:

catkin build --no-status --no-deps --this --make-args roslint

To run catkin lint, use the following command with catkin-tools:

catkin lint -W2

Use the following command with catkin-tools to run the small amount of available tests:

catkin run_tests --no-deps --this -i

Contribute

Please send PRs for new helper functions, fixes, etc!

CHANGELOG

Changelog for package rviz_visual_tools

2.1.0 (2016-02-09)

  • Allow publishArrow functions to specify ID
  • Contributors: Dave Coleman

2.0.3 (2016-01-10)

  • Renamed test to demo
  • Fix bug in random number generator
  • Noted a TODO
  • Documentation
  • Contributors: Dave Coleman

2.0.2 (2015-12-27)

  • Formatting
  • Removed unused var
  • roslint fixes
  • Contributors: Dave Coleman

2.0.1 (2015-12-05)

  • catkin lint cleanup
  • Updated travis badge
  • Updated README
  • Contributors: Dave Coleman

2.0.0 (2015-12-02)

  • Updated README
  • Add badges
  • Default true for enableBatchPublishing()
  • Renamed convertXYZRPY() to convertFromXYZRPY()
  • Changed roll pitch yall convention (fix)
  • Added preliminary unit tests
  • Hide include dependencies
  • New convertToXYZRPY function
  • Decrease wait time for topics to subscribe
  • New publishSphere and publishArrow functions
  • Added new thread safe pose conversion function
  • Auto format with clang
  • New publishSphere with frame_id function
  • New print transform functions
  • Fixed RPY error
  • New convert Affine3d to roll pitch yaw function
  • New tf_visual_tools functionality to help debug transforms
  • New parameter server isEnabled feature
  • Add id for wireframe cuboids
  • Namespaced publishWireframeCuboid
  • Helper function for publishAxisLabeled
  • New getBoolMap() function
  • New convertXYZRPY() function
  • Fix warnings
  • Fixed yellow
  • Fix internal publish bug
  • Check for empty parameter
  • New delayed publishing internal mode
  • added publishCuboid function for Eigen::Affine3d
  • New string vector param reading
  • added publishCuboid function for Eigen::Affine3d
  • Show whole param path
  • Added publish plane and cone
  • Renamed to publishAxisLabled()
  • New publishWireframeRectangle function
  • Fixed publishZArrow direction
  • New publishAxisWithLabel() function
  • Removed mute functionality
  • New publishWireframeRectangle() function
  • Improved memory reuse by utilizing member variables for conversion functions
  • Fixed ordering of functions in file
  • Added alpha values to fix planning scene visualization
  • Add WireframCuboid function to show oriented bounding boxes as computed ...
  • Made more function parameters passed by reference
  • Add color to wireframe
  • Add WireframCuboid function to show oriented bounding boxes as computed from PCL.
  • New generateRandomCuboid() function
  • Fixed formatting, added a PoseStamped version to publish[X|Y|Z]Arrow() functions
  • publishMesh() now has optional ID specification
  • Fixed generateRandomPose() bug
  • Added Eigen version of generateRandomPose()
  • changed floats to double in random pose struct, added publish block function to take pose
  • Updated rviz_visual_tools API
  • Deprecated publishRectangle() in favor of publishCuboid()
  • Added cyan and magenta
  • Added maintainer
  • Removed random pose bounds member variable in favor of using a funciton parameter
  • Added publish arrow functions
  • Added dark grey color
  • New publishLine function takes two Vector3's
  • added functionality to change bounds of random pose
  • New publishArrow function that allows stamped pose for arbitrary parent frames
  • added ArrayXXf to hold bounds on random pose
  • new publishLine function takes two Vector3's
  • Made yellow brighter
  • added marker array to rviz and modified generate random pose to give actual random pose
  • New publishArrow() functions
  • New batch publishing method - allows markers to be published in batches to reduce ROS messages being published
  • added method for displaying cuboids
  • added a clear overlay
  • New publishMesh function
  • Added Brown, Pink, and Lime Green colors
  • Copyright year
  • Contributors: Dave Coleman, Andy McEvoy, Jorge Ca

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro groovy. Known supported distros are highlighted in the buttons above.
No version for distro fuerte. Known supported distros are highlighted in the buttons above.
No version for distro electric. Known supported distros are highlighted in the buttons above.
No version for distro diamondback. Known supported distros are highlighted in the buttons above.