rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 4.1.4 |
License | BSD |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PickNikRobotics/rviz_visual_tools.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-09-04 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mike Lautman
Authors
- Mike Lautman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.
- ROS Kinetic Buildfarm - AMD64 Xenial Debian Build for Ubuntu 16.04
- ROS Kinetic Buildfarm - AMD64 Xenial Devel Build for Ubuntu 16.04
- ROS Melodic Buildfarm - AMD64 Bionic Debian Build for Ubuntu 18.04
- ROS Melodic Buildfarm - AMD64 Bionic Devel Build for Ubuntu 18.04
Install
Ubuntu Debian
sudo apt-get install ros-${ROS_DISTRO}-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 ${ROS_DISTRO}
Quick Start Demo
To see random shapes generated in Rviz, first launch Rviz:
ros2 launch rviz_visual_tools demo_rviz.launch.py
Then start the RViz Visual Tools demo:
ros2 run rviz_visual_tools rviz_visual_tools_demo
Code API
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.hpp>
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", node));
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::Isometry3d 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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
For more example code see rviz_visual_tools_demo.cpp
Rviz GUI Usage
NOT PORTED
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
NOT PORTED
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
NOT PORTED
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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
- publishText
- publishTest
And more…
Helper Functions
Reset function
-
deleteMarker(std::string namespace, std::size_t id)
- tells Rviz to clear a specific marker from being displayed. -
deleteAllMarkers()
- tells Rviz to clear out all current markers from being displayed.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
ros2 launch rviz_visual_tools demo_rviz.launch.py
ros2 run rviz_visual_tools rviz_visual_tools_imarker_simple_demo
TF Visual Tools
This tool lets you easily debug Eigen transforms in Rviz. Demo use:
rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Isometry3d world_to_shelf_transform = Eigen::Isometry3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");
Note: this is a work in progress
Testing and Linting
ROSlint is now run as a ROS test which can be run with the the following commands from your workspace directory (eg: ./ws_ros2).
catkin build --packages-select rviz_visual_tools
catkin test --packages-select rviz_visual_tools
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=$COLCON_WS/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" picknik/rviz_visual_tools:${ROS_DISTRO}
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t picknik/rviz_visual_tools:${ROS_DISTRO} .
Contribute
Please send PRs for new helper functions, fixes, etc!
When a pull request is opened, a reviewer is randomly assigned from the reviewer list using the Auto Assign Github Bot
Changelog for package rviz_visual_tools
4.1.4 (2023-01-05)
- Migrate to Ogre.h (#226)
- Remove galactic jobs since they are deprecated (#232)
- Add arbitrary color option to publishCuboid (#227)
- Bump clang-format version to 14 (#228)
- Contributors: Sebastian Castro, Stephanie Eng, Vatan Aksoy Tezer
4.1.3 (2022-07-18)
- Humble CI and formatting updates (#220)
- Minor typo fix (#222)
- Add a method to publish a plane using the normal and distance (#221) Co-authored-by: AndyZe <<andyz@utexas.edu>>
- Fix description of plane functions (#219)
- Update black version (#218)
- Add option to never wait for subscriber (#217)
- Contributors: Marq Rasmussen, Stephanie Eng, Vatan Aksoy Tezer
4.1.2 (2021-12-13)
- Fix faulty templated constructor (#211)
- Make sure to add all dependencies to the package.xml (#209) Otherwise it will fail to build on the buildfarm.
- Contributors: Chris Lalancette, Vatan Aksoy Tezer
4.1.1 (2021-10-07)
- Re-enable RemoteControl functionality
(#205)
- use condition_variable to be more thread safe
- Drop executor from constructor, deprecate old one
- Fix RemoteControl usage in demo
- Use SystemDefaultsQOS for RemoteControl subscriber
- Add RvizVisualToolsGui dashboard to rviz config, correct view
- Add pluginlib dependency. (#203)
- Fix package dependencies and cmake export (#202)
- Rename node_executable to executable (#200)
- Contributors: Davide Faconti, Henning Kayser, Jafar Abdi, Steven! Ragnarök, Vatan Aksoy Tezer
4.1.0 (2021-09-14)
- Fixes for new ros2 branch (#198)
- Fix include deprecation warning
- Enable Galactic and Rolling CI
(#190)
- minor compile fixes
- Fixes & improvements for deleting markers
(#188)
- Added RvizVisualTools method to delete all markers in a namespace
- Fixed deleteAllMarkers for all namespaces
- Added getters for marker ID's
- Move waitForSubscriber function to header file (#185)
- Contributors: Henning Kayser, Jafar Abdi, Nathan Brooks, Vatan Aksoy Tezer, Wyatt Rees
4.0.0 (2021-04-09)
- Fix warning about deprecation (#180) rclcpp::executor::FutureReturnCode was removed
- Update to offer shared_ptr to create_timer
- Fix rviz_visual_tools_gui (#147)
- Compilation for Windows (#143)
- Remove stl file in preparation for LFS setup (#140)
- Add function deleteMarker: deletes marker for given namespace and id (#137)
- fix waitForSubscriber time (#142)
- Eloquent cleanup
(#135)
- some misc cleanup of the imarker simple lib
- actually reset marker counts
- changes for using IMarker simple as a library
- Fix rviz warnings about scale and uninitialized quaternions (#129)
- Normalize interactive marker quaternions. (#132)
- normalize before publish (#131)
- New helper function getIdentityPose() (#122)
- For ABCD planes: better comments, ensure the plane equation is satisfied. (#120) Co-Authored-By: Henning Kayser <<henningkayser@picknik.ai>>
- Make [rviz_visual_tools]{.title-ref} publish triangle mesh and
[tf_visual_tools]{.title-ref} clean published transforms
(#117)
- Add [clearAllTransform]{.title-ref} method to tf_visual_tools
- Add new function to publish mesh marker from triangles and vertices
- Publish plane from Ax+By+Cz+D=0 equation (#119)
- Fixed publishCylinder namespace (#109)
- Remove default arguments to make function calls not ambiguous (#112)
- Initialize quaternions in demo to avoid warning (#111)
- Fix node type in demo launch files (#110)
- Use LOGNAME for logging re:moveit styel (#106)
- Contributors: AndyZe, Bjar Ne, Dave Coleman, Jafar Abdi, Mike Lautman, Mori, MoriKen, Nathan Brooks, Sean Yen, Victor Lamoine, Yu Yan, d-walsh, hshose
3.7.0 (2018-11-26)
- Fix Eigen::Affine3d for Melodic (using Eigen::Isometry3d) (#105)
- Improve documentation (#100)
- Fix some catkin_lint warnings and rename targets output (#98)
- Update README Kinetic to Melodic (#102)
- Add Melodic build farm badges (#99)
- Add ccache support (#93)
- no ros::spinOnce() (#82)
- Deprecate old functions for ROS Melodic (#91)
- Improve package with catkin_lint (#89)
- Add OGRE dependency (#88)
- Automoc requires at least cmake version 2.8.6 (#86)
- Fix Travis badge (#84)
- The code already uses AUTOMOC (#76)
- Contributors: Dave Coleman, Jochen Sprickerhof, Michael Görner, Simon Schmeisser, Victor Lamoine
3.6.1 (2018-05-31)
- Actually link qt code into the gui library (#74)
- Contributors: Michael Goerner
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
moveit_visual_tools | |
lidar_situational_graphs |
Launch files
- launch/rvt_test.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 4.1.4 |
License | BSD |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PickNikRobotics/rviz_visual_tools.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-09-04 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mike Lautman
Authors
- Mike Lautman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.
- ROS Kinetic Buildfarm - AMD64 Xenial Debian Build for Ubuntu 16.04
- ROS Kinetic Buildfarm - AMD64 Xenial Devel Build for Ubuntu 16.04
- ROS Melodic Buildfarm - AMD64 Bionic Debian Build for Ubuntu 18.04
- ROS Melodic Buildfarm - AMD64 Bionic Devel Build for Ubuntu 18.04
Install
Ubuntu Debian
sudo apt-get install ros-${ROS_DISTRO}-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 ${ROS_DISTRO}
Quick Start Demo
To see random shapes generated in Rviz, first launch Rviz:
ros2 launch rviz_visual_tools demo_rviz.launch.py
Then start the RViz Visual Tools demo:
ros2 run rviz_visual_tools rviz_visual_tools_demo
Code API
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.hpp>
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", node));
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::Isometry3d 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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
For more example code see rviz_visual_tools_demo.cpp
Rviz GUI Usage
NOT PORTED
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
NOT PORTED
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
NOT PORTED
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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
- publishText
- publishTest
And more…
Helper Functions
Reset function
-
deleteMarker(std::string namespace, std::size_t id)
- tells Rviz to clear a specific marker from being displayed. -
deleteAllMarkers()
- tells Rviz to clear out all current markers from being displayed.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
ros2 launch rviz_visual_tools demo_rviz.launch.py
ros2 run rviz_visual_tools rviz_visual_tools_imarker_simple_demo
TF Visual Tools
This tool lets you easily debug Eigen transforms in Rviz. Demo use:
rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Isometry3d world_to_shelf_transform = Eigen::Isometry3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");
Note: this is a work in progress
Testing and Linting
ROSlint is now run as a ROS test which can be run with the the following commands from your workspace directory (eg: ./ws_ros2).
catkin build --packages-select rviz_visual_tools
catkin test --packages-select rviz_visual_tools
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=$COLCON_WS/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" picknik/rviz_visual_tools:${ROS_DISTRO}
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t picknik/rviz_visual_tools:${ROS_DISTRO} .
Contribute
Please send PRs for new helper functions, fixes, etc!
When a pull request is opened, a reviewer is randomly assigned from the reviewer list using the Auto Assign Github Bot
Changelog for package rviz_visual_tools
4.1.4 (2023-01-05)
- Migrate to Ogre.h (#226)
- Remove galactic jobs since they are deprecated (#232)
- Add arbitrary color option to publishCuboid (#227)
- Bump clang-format version to 14 (#228)
- Contributors: Sebastian Castro, Stephanie Eng, Vatan Aksoy Tezer
4.1.3 (2022-07-18)
- Humble CI and formatting updates (#220)
- Minor typo fix (#222)
- Add a method to publish a plane using the normal and distance (#221) Co-authored-by: AndyZe <<andyz@utexas.edu>>
- Fix description of plane functions (#219)
- Update black version (#218)
- Add option to never wait for subscriber (#217)
- Contributors: Marq Rasmussen, Stephanie Eng, Vatan Aksoy Tezer
4.1.2 (2021-12-13)
- Fix faulty templated constructor (#211)
- Make sure to add all dependencies to the package.xml (#209) Otherwise it will fail to build on the buildfarm.
- Contributors: Chris Lalancette, Vatan Aksoy Tezer
4.1.1 (2021-10-07)
- Re-enable RemoteControl functionality
(#205)
- use condition_variable to be more thread safe
- Drop executor from constructor, deprecate old one
- Fix RemoteControl usage in demo
- Use SystemDefaultsQOS for RemoteControl subscriber
- Add RvizVisualToolsGui dashboard to rviz config, correct view
- Add pluginlib dependency. (#203)
- Fix package dependencies and cmake export (#202)
- Rename node_executable to executable (#200)
- Contributors: Davide Faconti, Henning Kayser, Jafar Abdi, Steven! Ragnarök, Vatan Aksoy Tezer
4.1.0 (2021-09-14)
- Fixes for new ros2 branch (#198)
- Fix include deprecation warning
- Enable Galactic and Rolling CI
(#190)
- minor compile fixes
- Fixes & improvements for deleting markers
(#188)
- Added RvizVisualTools method to delete all markers in a namespace
- Fixed deleteAllMarkers for all namespaces
- Added getters for marker ID's
- Move waitForSubscriber function to header file (#185)
- Contributors: Henning Kayser, Jafar Abdi, Nathan Brooks, Vatan Aksoy Tezer, Wyatt Rees
4.0.0 (2021-04-09)
- Fix warning about deprecation (#180) rclcpp::executor::FutureReturnCode was removed
- Update to offer shared_ptr to create_timer
- Fix rviz_visual_tools_gui (#147)
- Compilation for Windows (#143)
- Remove stl file in preparation for LFS setup (#140)
- Add function deleteMarker: deletes marker for given namespace and id (#137)
- fix waitForSubscriber time (#142)
- Eloquent cleanup
(#135)
- some misc cleanup of the imarker simple lib
- actually reset marker counts
- changes for using IMarker simple as a library
- Fix rviz warnings about scale and uninitialized quaternions (#129)
- Normalize interactive marker quaternions. (#132)
- normalize before publish (#131)
- New helper function getIdentityPose() (#122)
- For ABCD planes: better comments, ensure the plane equation is satisfied. (#120) Co-Authored-By: Henning Kayser <<henningkayser@picknik.ai>>
- Make [rviz_visual_tools]{.title-ref} publish triangle mesh and
[tf_visual_tools]{.title-ref} clean published transforms
(#117)
- Add [clearAllTransform]{.title-ref} method to tf_visual_tools
- Add new function to publish mesh marker from triangles and vertices
- Publish plane from Ax+By+Cz+D=0 equation (#119)
- Fixed publishCylinder namespace (#109)
- Remove default arguments to make function calls not ambiguous (#112)
- Initialize quaternions in demo to avoid warning (#111)
- Fix node type in demo launch files (#110)
- Use LOGNAME for logging re:moveit styel (#106)
- Contributors: AndyZe, Bjar Ne, Dave Coleman, Jafar Abdi, Mike Lautman, Mori, MoriKen, Nathan Brooks, Sean Yen, Victor Lamoine, Yu Yan, d-walsh, hshose
3.7.0 (2018-11-26)
- Fix Eigen::Affine3d for Melodic (using Eigen::Isometry3d) (#105)
- Improve documentation (#100)
- Fix some catkin_lint warnings and rename targets output (#98)
- Update README Kinetic to Melodic (#102)
- Add Melodic build farm badges (#99)
- Add ccache support (#93)
- no ros::spinOnce() (#82)
- Deprecate old functions for ROS Melodic (#91)
- Improve package with catkin_lint (#89)
- Add OGRE dependency (#88)
- Automoc requires at least cmake version 2.8.6 (#86)
- Fix Travis badge (#84)
- The code already uses AUTOMOC (#76)
- Contributors: Dave Coleman, Jochen Sprickerhof, Michael Görner, Simon Schmeisser, Victor Lamoine
3.6.1 (2018-05-31)
- Actually link qt code into the gui library (#74)
- Contributors: Michael Goerner
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
moveit_visual_tools | |
lidar_situational_graphs |
Launch files
- launch/rvt_test.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 4.1.4 |
License | BSD |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PickNikRobotics/rviz_visual_tools.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-09-04 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mike Lautman
Authors
- Mike Lautman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.
- ROS Kinetic Buildfarm - AMD64 Xenial Debian Build for Ubuntu 16.04
- ROS Kinetic Buildfarm - AMD64 Xenial Devel Build for Ubuntu 16.04
- ROS Melodic Buildfarm - AMD64 Bionic Debian Build for Ubuntu 18.04
- ROS Melodic Buildfarm - AMD64 Bionic Devel Build for Ubuntu 18.04
Install
Ubuntu Debian
sudo apt-get install ros-${ROS_DISTRO}-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 ${ROS_DISTRO}
Quick Start Demo
To see random shapes generated in Rviz, first launch Rviz:
ros2 launch rviz_visual_tools demo_rviz.launch.py
Then start the RViz Visual Tools demo:
ros2 run rviz_visual_tools rviz_visual_tools_demo
Code API
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.hpp>
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", node));
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::Isometry3d 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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
For more example code see rviz_visual_tools_demo.cpp
Rviz GUI Usage
NOT PORTED
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
NOT PORTED
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
NOT PORTED
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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
- publishText
- publishTest
And more…
Helper Functions
Reset function
-
deleteMarker(std::string namespace, std::size_t id)
- tells Rviz to clear a specific marker from being displayed. -
deleteAllMarkers()
- tells Rviz to clear out all current markers from being displayed.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
ros2 launch rviz_visual_tools demo_rviz.launch.py
ros2 run rviz_visual_tools rviz_visual_tools_imarker_simple_demo
TF Visual Tools
This tool lets you easily debug Eigen transforms in Rviz. Demo use:
rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Isometry3d world_to_shelf_transform = Eigen::Isometry3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");
Note: this is a work in progress
Testing and Linting
ROSlint is now run as a ROS test which can be run with the the following commands from your workspace directory (eg: ./ws_ros2).
catkin build --packages-select rviz_visual_tools
catkin test --packages-select rviz_visual_tools
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=$COLCON_WS/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" picknik/rviz_visual_tools:${ROS_DISTRO}
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t picknik/rviz_visual_tools:${ROS_DISTRO} .
Contribute
Please send PRs for new helper functions, fixes, etc!
When a pull request is opened, a reviewer is randomly assigned from the reviewer list using the Auto Assign Github Bot
Changelog for package rviz_visual_tools
4.1.4 (2023-01-05)
- Migrate to Ogre.h (#226)
- Remove galactic jobs since they are deprecated (#232)
- Add arbitrary color option to publishCuboid (#227)
- Bump clang-format version to 14 (#228)
- Contributors: Sebastian Castro, Stephanie Eng, Vatan Aksoy Tezer
4.1.3 (2022-07-18)
- Humble CI and formatting updates (#220)
- Minor typo fix (#222)
- Add a method to publish a plane using the normal and distance (#221) Co-authored-by: AndyZe <<andyz@utexas.edu>>
- Fix description of plane functions (#219)
- Update black version (#218)
- Add option to never wait for subscriber (#217)
- Contributors: Marq Rasmussen, Stephanie Eng, Vatan Aksoy Tezer
4.1.2 (2021-12-13)
- Fix faulty templated constructor (#211)
- Make sure to add all dependencies to the package.xml (#209) Otherwise it will fail to build on the buildfarm.
- Contributors: Chris Lalancette, Vatan Aksoy Tezer
4.1.1 (2021-10-07)
- Re-enable RemoteControl functionality
(#205)
- use condition_variable to be more thread safe
- Drop executor from constructor, deprecate old one
- Fix RemoteControl usage in demo
- Use SystemDefaultsQOS for RemoteControl subscriber
- Add RvizVisualToolsGui dashboard to rviz config, correct view
- Add pluginlib dependency. (#203)
- Fix package dependencies and cmake export (#202)
- Rename node_executable to executable (#200)
- Contributors: Davide Faconti, Henning Kayser, Jafar Abdi, Steven! Ragnarök, Vatan Aksoy Tezer
4.1.0 (2021-09-14)
- Fixes for new ros2 branch (#198)
- Fix include deprecation warning
- Enable Galactic and Rolling CI
(#190)
- minor compile fixes
- Fixes & improvements for deleting markers
(#188)
- Added RvizVisualTools method to delete all markers in a namespace
- Fixed deleteAllMarkers for all namespaces
- Added getters for marker ID's
- Move waitForSubscriber function to header file (#185)
- Contributors: Henning Kayser, Jafar Abdi, Nathan Brooks, Vatan Aksoy Tezer, Wyatt Rees
4.0.0 (2021-04-09)
- Fix warning about deprecation (#180) rclcpp::executor::FutureReturnCode was removed
- Update to offer shared_ptr to create_timer
- Fix rviz_visual_tools_gui (#147)
- Compilation for Windows (#143)
- Remove stl file in preparation for LFS setup (#140)
- Add function deleteMarker: deletes marker for given namespace and id (#137)
- fix waitForSubscriber time (#142)
- Eloquent cleanup
(#135)
- some misc cleanup of the imarker simple lib
- actually reset marker counts
- changes for using IMarker simple as a library
- Fix rviz warnings about scale and uninitialized quaternions (#129)
- Normalize interactive marker quaternions. (#132)
- normalize before publish (#131)
- New helper function getIdentityPose() (#122)
- For ABCD planes: better comments, ensure the plane equation is satisfied. (#120) Co-Authored-By: Henning Kayser <<henningkayser@picknik.ai>>
- Make [rviz_visual_tools]{.title-ref} publish triangle mesh and
[tf_visual_tools]{.title-ref} clean published transforms
(#117)
- Add [clearAllTransform]{.title-ref} method to tf_visual_tools
- Add new function to publish mesh marker from triangles and vertices
- Publish plane from Ax+By+Cz+D=0 equation (#119)
- Fixed publishCylinder namespace (#109)
- Remove default arguments to make function calls not ambiguous (#112)
- Initialize quaternions in demo to avoid warning (#111)
- Fix node type in demo launch files (#110)
- Use LOGNAME for logging re:moveit styel (#106)
- Contributors: AndyZe, Bjar Ne, Dave Coleman, Jafar Abdi, Mike Lautman, Mori, MoriKen, Nathan Brooks, Sean Yen, Victor Lamoine, Yu Yan, d-walsh, hshose
3.7.0 (2018-11-26)
- Fix Eigen::Affine3d for Melodic (using Eigen::Isometry3d) (#105)
- Improve documentation (#100)
- Fix some catkin_lint warnings and rename targets output (#98)
- Update README Kinetic to Melodic (#102)
- Add Melodic build farm badges (#99)
- Add ccache support (#93)
- no ros::spinOnce() (#82)
- Deprecate old functions for ROS Melodic (#91)
- Improve package with catkin_lint (#89)
- Add OGRE dependency (#88)
- Automoc requires at least cmake version 2.8.6 (#86)
- Fix Travis badge (#84)
- The code already uses AUTOMOC (#76)
- Contributors: Dave Coleman, Jochen Sprickerhof, Michael Görner, Simon Schmeisser, Victor Lamoine
3.6.1 (2018-05-31)
- Actually link qt code into the gui library (#74)
- Contributors: Michael Goerner
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
moveit_visual_tools |
Launch files
- launch/rvt_test.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 4.1.4 |
License | BSD |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PickNikRobotics/rviz_visual_tools.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-09-04 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mike Lautman
Authors
- Mike Lautman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.
- ROS Kinetic Buildfarm - AMD64 Xenial Debian Build for Ubuntu 16.04
- ROS Kinetic Buildfarm - AMD64 Xenial Devel Build for Ubuntu 16.04
- ROS Melodic Buildfarm - AMD64 Bionic Debian Build for Ubuntu 18.04
- ROS Melodic Buildfarm - AMD64 Bionic Devel Build for Ubuntu 18.04
Install
Ubuntu Debian
sudo apt-get install ros-${ROS_DISTRO}-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 ${ROS_DISTRO}
Quick Start Demo
To see random shapes generated in Rviz, first launch Rviz:
ros2 launch rviz_visual_tools demo_rviz.launch.py
Then start the RViz Visual Tools demo:
ros2 run rviz_visual_tools rviz_visual_tools_demo
Code API
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.hpp>
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", node));
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::Isometry3d 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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
For more example code see rviz_visual_tools_demo.cpp
Rviz GUI Usage
NOT PORTED
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
NOT PORTED
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
NOT PORTED
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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
- publishText
- publishTest
And more…
Helper Functions
Reset function
-
deleteMarker(std::string namespace, std::size_t id)
- tells Rviz to clear a specific marker from being displayed. -
deleteAllMarkers()
- tells Rviz to clear out all current markers from being displayed.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
ros2 launch rviz_visual_tools demo_rviz.launch.py
ros2 run rviz_visual_tools rviz_visual_tools_imarker_simple_demo
TF Visual Tools
This tool lets you easily debug Eigen transforms in Rviz. Demo use:
rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Isometry3d world_to_shelf_transform = Eigen::Isometry3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");
Note: this is a work in progress
Testing and Linting
ROSlint is now run as a ROS test which can be run with the the following commands from your workspace directory (eg: ./ws_ros2).
catkin build --packages-select rviz_visual_tools
catkin test --packages-select rviz_visual_tools
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=$COLCON_WS/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" picknik/rviz_visual_tools:${ROS_DISTRO}
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t picknik/rviz_visual_tools:${ROS_DISTRO} .
Contribute
Please send PRs for new helper functions, fixes, etc!
When a pull request is opened, a reviewer is randomly assigned from the reviewer list using the Auto Assign Github Bot
Changelog for package rviz_visual_tools
4.1.4 (2023-01-05)
- Migrate to Ogre.h (#226)
- Remove galactic jobs since they are deprecated (#232)
- Add arbitrary color option to publishCuboid (#227)
- Bump clang-format version to 14 (#228)
- Contributors: Sebastian Castro, Stephanie Eng, Vatan Aksoy Tezer
4.1.3 (2022-07-18)
- Humble CI and formatting updates (#220)
- Minor typo fix (#222)
- Add a method to publish a plane using the normal and distance (#221) Co-authored-by: AndyZe <<andyz@utexas.edu>>
- Fix description of plane functions (#219)
- Update black version (#218)
- Add option to never wait for subscriber (#217)
- Contributors: Marq Rasmussen, Stephanie Eng, Vatan Aksoy Tezer
4.1.2 (2021-12-13)
- Fix faulty templated constructor (#211)
- Make sure to add all dependencies to the package.xml (#209) Otherwise it will fail to build on the buildfarm.
- Contributors: Chris Lalancette, Vatan Aksoy Tezer
4.1.1 (2021-10-07)
- Re-enable RemoteControl functionality
(#205)
- use condition_variable to be more thread safe
- Drop executor from constructor, deprecate old one
- Fix RemoteControl usage in demo
- Use SystemDefaultsQOS for RemoteControl subscriber
- Add RvizVisualToolsGui dashboard to rviz config, correct view
- Add pluginlib dependency. (#203)
- Fix package dependencies and cmake export (#202)
- Rename node_executable to executable (#200)
- Contributors: Davide Faconti, Henning Kayser, Jafar Abdi, Steven! Ragnarök, Vatan Aksoy Tezer
4.1.0 (2021-09-14)
- Fixes for new ros2 branch (#198)
- Fix include deprecation warning
- Enable Galactic and Rolling CI
(#190)
- minor compile fixes
- Fixes & improvements for deleting markers
(#188)
- Added RvizVisualTools method to delete all markers in a namespace
- Fixed deleteAllMarkers for all namespaces
- Added getters for marker ID's
- Move waitForSubscriber function to header file (#185)
- Contributors: Henning Kayser, Jafar Abdi, Nathan Brooks, Vatan Aksoy Tezer, Wyatt Rees
4.0.0 (2021-04-09)
- Fix warning about deprecation (#180) rclcpp::executor::FutureReturnCode was removed
- Update to offer shared_ptr to create_timer
- Fix rviz_visual_tools_gui (#147)
- Compilation for Windows (#143)
- Remove stl file in preparation for LFS setup (#140)
- Add function deleteMarker: deletes marker for given namespace and id (#137)
- fix waitForSubscriber time (#142)
- Eloquent cleanup
(#135)
- some misc cleanup of the imarker simple lib
- actually reset marker counts
- changes for using IMarker simple as a library
- Fix rviz warnings about scale and uninitialized quaternions (#129)
- Normalize interactive marker quaternions. (#132)
- normalize before publish (#131)
- New helper function getIdentityPose() (#122)
- For ABCD planes: better comments, ensure the plane equation is satisfied. (#120) Co-Authored-By: Henning Kayser <<henningkayser@picknik.ai>>
- Make [rviz_visual_tools]{.title-ref} publish triangle mesh and
[tf_visual_tools]{.title-ref} clean published transforms
(#117)
- Add [clearAllTransform]{.title-ref} method to tf_visual_tools
- Add new function to publish mesh marker from triangles and vertices
- Publish plane from Ax+By+Cz+D=0 equation (#119)
- Fixed publishCylinder namespace (#109)
- Remove default arguments to make function calls not ambiguous (#112)
- Initialize quaternions in demo to avoid warning (#111)
- Fix node type in demo launch files (#110)
- Use LOGNAME for logging re:moveit styel (#106)
- Contributors: AndyZe, Bjar Ne, Dave Coleman, Jafar Abdi, Mike Lautman, Mori, MoriKen, Nathan Brooks, Sean Yen, Victor Lamoine, Yu Yan, d-walsh, hshose
3.7.0 (2018-11-26)
- Fix Eigen::Affine3d for Melodic (using Eigen::Isometry3d) (#105)
- Improve documentation (#100)
- Fix some catkin_lint warnings and rename targets output (#98)
- Update README Kinetic to Melodic (#102)
- Add Melodic build farm badges (#99)
- Add ccache support (#93)
- no ros::spinOnce() (#82)
- Deprecate old functions for ROS Melodic (#91)
- Improve package with catkin_lint (#89)
- Add OGRE dependency (#88)
- Automoc requires at least cmake version 2.8.6 (#86)
- Fix Travis badge (#84)
- The code already uses AUTOMOC (#76)
- Contributors: Dave Coleman, Jochen Sprickerhof, Michael Görner, Simon Schmeisser, Victor Lamoine
3.6.1 (2018-05-31)
- Actually link qt code into the gui library (#74)
- Contributors: Michael Goerner
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
moveit_visual_tools |
Launch files
- launch/rvt_test.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 3.9.1 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PickNikRobotics/rviz_visual_tools.git |
VCS Type | git |
VCS Version | noetic-devel |
Last Updated | 2020-10-09 |
Dev Status | MAINTAINED |
CI status |
|
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Dave Coleman
Authors
- Dave Coleman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
This open source project was developed at PickNik Robotics. Need professional ROS development and consulting? Contact us at projects@picknik.ai for a free consultation.
- Travis CI
- ROS Kinetic Buildfarm - AMD64 Xenial Debian Build for Ubuntu 16.04
- ROS Kinetic Buildfarm - AMD64 Xenial Devel Build for Ubuntu 16.04
- ROS Melodic Buildfarm - AMD64 Bionic Debian Build for Ubuntu 18.04
- ROS Melodic Buildfarm - AMD64 Bionic Devel Build for Ubuntu 18.04
Install
Ubuntu Debian
sudo apt-get install ros-melodic-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 melodic
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
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::Isometry3d 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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
For more example code see rviz_visual_tools_demo.cpp
Rviz GUI Usage
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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
- publishText
- publishTest
And more…
Helper Functions
Reset function
-
deleteAllMarkers()
- tells Rviz to clear out all current markers from being displayed.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
roslaunch rviz_visual_tools demo_rviz.launch
rosrun rviz_visual_tools imarker_simple_demo
TF Visual Tools
This tool lets you easily debug Eigen transforms in Rviz. Demo use:
rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Isometry3d world_to_shelf_transform = Eigen::Isometry3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");
Note: this is a work in progress
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
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=/home/dave/ros/current/ws_moveit/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" davetcoleman/rviz_visual_tools:melodic
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t davetcoleman/rviz_visual_tools:melodic .
Contribute
Please send PRs for new helper functions, fixes, etc!
When a pull request is opened, a reviewer is randomly assigned from the reviewer list using the Auto Assign Github Bot
Changelog for package rviz_visual_tools
3.9.1 (2020-10-09)
- [maint] add soname versions to libraries (#166)
- [maint] Apply clang-format-10 (#173)
- Contributors: Tyler Weaver
3.9.0 (2020-09-05)
- [feature] Add optional parent frame to iMarker (#159)
- [feature] Publish cuboid with size as a vector3 or Eigen::Vector3d (#125)
- [feature] Normalize interactive marker quaternions. (#132)
- [feature] normalize before publish (#131)
- [feature] New helper function getIdentityPose() (#122)
- [feature] Windows bring up. (#116)
- [feature] For ABCD planes: better comments, ensure the plane equation is satisfied. (#120)
- [feature] Make [rviz_visual_tools]{.title-ref} publish triangle mesh and [tf_visual_tools]{.title-ref} clean published transforms (#117)
- [feature] Publish plane from Ax+By+Cz+D=0 equation (#119)
- [feature] Remove default arguments to make function calls not ambiguous (#112)
- [feature] Initizalize quaternions in demo to avoid warning (#111)
- [fix] rviz warnings about scale and uninitialized quaternions (#129)
- [fix] publishCylinder namespace (#109)
- [fix] node type in demo launch files (#110)
- [maint] Adding missing dependency (interactive_markers) (#168)
- [maint] clang-tidy (#158)
- [maint] replace tf_conversions with tf2 (#151)
- [maint] bump cmake version (#150)
- [maint] remove trailing whitespaces (#130)
- [maint] Apply clang-tidy (#127)
- [maint] Switch to moveit_ci, apply clang-format (#124)
- [maint] Use LOGNAME for logging re:moveit styel (#106)
- Contributors: AndyZe, Bjar Ne, Dave Coleman, Jafar Abdi, JafarAbdi, Michael Görner, Mike Lautman, Sean Yen, Victor Lamoine, Yu, Yan, d-walsh
3.7.0 (2018-11-26)
- Fix Eigen::Affine3d for Melodic (using Eigen::Isometry3d) (#105)
- Improve documentation (#100)
- Fix some catkin_lint warnings and rename targets output (#98)
- Update README Kinetic to Melodic (#102)
- Add Melodic build farm badges (#99)
- Add ccache support (#93)
- no ros::spinOnce() (#82)
- Deprecate old functions for ROS Melodic (#91)
- Improve package with catkin_lint (#89)
- Add OGRE dependency (#88)
- Automoc requires at least cmake version 2.8.6 (#86)
- Fix Travis badge (#84)
- The code already uses AUTOMOC (#76)
- Contributors: Dave Coleman, Jochen Sprickerhof, Michael Görner, Simon Schmeisser, Victor Lamoine
3.6.1 (2018-05-31)
- Actually link qt code into the gui library (#74)
- Contributors: Michael Goerner
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/demo_rviz.launch
- launch/rvt_test.launch
-
- debug [default: false]
- launch/demo_combined.launch
-
- debug [default: false]
- launch/demo.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 4.1.4 |
License | BSD |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PickNikRobotics/rviz_visual_tools.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-09-04 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mike Lautman
Authors
- Mike Lautman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.
- ROS Kinetic Buildfarm - AMD64 Xenial Debian Build for Ubuntu 16.04
- ROS Kinetic Buildfarm - AMD64 Xenial Devel Build for Ubuntu 16.04
- ROS Melodic Buildfarm - AMD64 Bionic Debian Build for Ubuntu 18.04
- ROS Melodic Buildfarm - AMD64 Bionic Devel Build for Ubuntu 18.04
Install
Ubuntu Debian
sudo apt-get install ros-${ROS_DISTRO}-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 ${ROS_DISTRO}
Quick Start Demo
To see random shapes generated in Rviz, first launch Rviz:
ros2 launch rviz_visual_tools demo_rviz.launch.py
Then start the RViz Visual Tools demo:
ros2 run rviz_visual_tools rviz_visual_tools_demo
Code API
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.hpp>
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", node));
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::Isometry3d 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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
For more example code see rviz_visual_tools_demo.cpp
Rviz GUI Usage
NOT PORTED
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
NOT PORTED
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
NOT PORTED
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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
- publishText
- publishTest
And more…
Helper Functions
Reset function
-
deleteMarker(std::string namespace, std::size_t id)
- tells Rviz to clear a specific marker from being displayed. -
deleteAllMarkers()
- tells Rviz to clear out all current markers from being displayed.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
ros2 launch rviz_visual_tools demo_rviz.launch.py
ros2 run rviz_visual_tools rviz_visual_tools_imarker_simple_demo
TF Visual Tools
This tool lets you easily debug Eigen transforms in Rviz. Demo use:
rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Isometry3d world_to_shelf_transform = Eigen::Isometry3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");
Note: this is a work in progress
Testing and Linting
ROSlint is now run as a ROS test which can be run with the the following commands from your workspace directory (eg: ./ws_ros2).
catkin build --packages-select rviz_visual_tools
catkin test --packages-select rviz_visual_tools
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=$COLCON_WS/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" picknik/rviz_visual_tools:${ROS_DISTRO}
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t picknik/rviz_visual_tools:${ROS_DISTRO} .
Contribute
Please send PRs for new helper functions, fixes, etc!
When a pull request is opened, a reviewer is randomly assigned from the reviewer list using the Auto Assign Github Bot
Changelog for package rviz_visual_tools
4.1.4 (2023-01-05)
- Migrate to Ogre.h (#226)
- Remove galactic jobs since they are deprecated (#232)
- Add arbitrary color option to publishCuboid (#227)
- Bump clang-format version to 14 (#228)
- Contributors: Sebastian Castro, Stephanie Eng, Vatan Aksoy Tezer
4.1.3 (2022-07-18)
- Humble CI and formatting updates (#220)
- Minor typo fix (#222)
- Add a method to publish a plane using the normal and distance (#221) Co-authored-by: AndyZe <<andyz@utexas.edu>>
- Fix description of plane functions (#219)
- Update black version (#218)
- Add option to never wait for subscriber (#217)
- Contributors: Marq Rasmussen, Stephanie Eng, Vatan Aksoy Tezer
4.1.2 (2021-12-13)
- Fix faulty templated constructor (#211)
- Make sure to add all dependencies to the package.xml (#209) Otherwise it will fail to build on the buildfarm.
- Contributors: Chris Lalancette, Vatan Aksoy Tezer
4.1.1 (2021-10-07)
- Re-enable RemoteControl functionality
(#205)
- use condition_variable to be more thread safe
- Drop executor from constructor, deprecate old one
- Fix RemoteControl usage in demo
- Use SystemDefaultsQOS for RemoteControl subscriber
- Add RvizVisualToolsGui dashboard to rviz config, correct view
- Add pluginlib dependency. (#203)
- Fix package dependencies and cmake export (#202)
- Rename node_executable to executable (#200)
- Contributors: Davide Faconti, Henning Kayser, Jafar Abdi, Steven! Ragnarök, Vatan Aksoy Tezer
4.1.0 (2021-09-14)
- Fixes for new ros2 branch (#198)
- Fix include deprecation warning
- Enable Galactic and Rolling CI
(#190)
- minor compile fixes
- Fixes & improvements for deleting markers
(#188)
- Added RvizVisualTools method to delete all markers in a namespace
- Fixed deleteAllMarkers for all namespaces
- Added getters for marker ID's
- Move waitForSubscriber function to header file (#185)
- Contributors: Henning Kayser, Jafar Abdi, Nathan Brooks, Vatan Aksoy Tezer, Wyatt Rees
4.0.0 (2021-04-09)
- Fix warning about deprecation (#180) rclcpp::executor::FutureReturnCode was removed
- Update to offer shared_ptr to create_timer
- Fix rviz_visual_tools_gui (#147)
- Compilation for Windows (#143)
- Remove stl file in preparation for LFS setup (#140)
- Add function deleteMarker: deletes marker for given namespace and id (#137)
- fix waitForSubscriber time (#142)
- Eloquent cleanup
(#135)
- some misc cleanup of the imarker simple lib
- actually reset marker counts
- changes for using IMarker simple as a library
- Fix rviz warnings about scale and uninitialized quaternions (#129)
- Normalize interactive marker quaternions. (#132)
- normalize before publish (#131)
- New helper function getIdentityPose() (#122)
- For ABCD planes: better comments, ensure the plane equation is satisfied. (#120) Co-Authored-By: Henning Kayser <<henningkayser@picknik.ai>>
- Make [rviz_visual_tools]{.title-ref} publish triangle mesh and
[tf_visual_tools]{.title-ref} clean published transforms
(#117)
- Add [clearAllTransform]{.title-ref} method to tf_visual_tools
- Add new function to publish mesh marker from triangles and vertices
- Publish plane from Ax+By+Cz+D=0 equation (#119)
- Fixed publishCylinder namespace (#109)
- Remove default arguments to make function calls not ambiguous (#112)
- Initialize quaternions in demo to avoid warning (#111)
- Fix node type in demo launch files (#110)
- Use LOGNAME for logging re:moveit styel (#106)
- Contributors: AndyZe, Bjar Ne, Dave Coleman, Jafar Abdi, Mike Lautman, Mori, MoriKen, Nathan Brooks, Sean Yen, Victor Lamoine, Yu Yan, d-walsh, hshose
3.7.0 (2018-11-26)
- Fix Eigen::Affine3d for Melodic (using Eigen::Isometry3d) (#105)
- Improve documentation (#100)
- Fix some catkin_lint warnings and rename targets output (#98)
- Update README Kinetic to Melodic (#102)
- Add Melodic build farm badges (#99)
- Add ccache support (#93)
- no ros::spinOnce() (#82)
- Deprecate old functions for ROS Melodic (#91)
- Improve package with catkin_lint (#89)
- Add OGRE dependency (#88)
- Automoc requires at least cmake version 2.8.6 (#86)
- Fix Travis badge (#84)
- The code already uses AUTOMOC (#76)
- Contributors: Dave Coleman, Jochen Sprickerhof, Michael Görner, Simon Schmeisser, Victor Lamoine
3.6.1 (2018-05-31)
- Actually link qt code into the gui library (#74)
- Contributors: Michael Goerner
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
moveit_visual_tools |
Launch files
- launch/rvt_test.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 4.0.3 |
License | BSD |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PickNikRobotics/rviz_visual_tools.git |
VCS Type | git |
VCS Version | foxy-devel |
Last Updated | 2021-12-13 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mike Lautman
Authors
- Mike Lautman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.
- ROS Kinetic Buildfarm - AMD64 Xenial Debian Build for Ubuntu 16.04
- ROS Kinetic Buildfarm - AMD64 Xenial Devel Build for Ubuntu 16.04
- ROS Melodic Buildfarm - AMD64 Bionic Debian Build for Ubuntu 18.04
- ROS Melodic Buildfarm - AMD64 Bionic Devel Build for Ubuntu 18.04
Install
Ubuntu Debian
sudo apt-get install ros-${ROS_DISTRO}-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 ${ROS_DISTRO}
Quick Start Demo
To see random shapes generated in Rviz, first launch Rviz:
ros2 launch rviz_visual_tools demo_rviz.launch.py
Then start the RViz Visual Tools demo:
ros2 run rviz_visual_tools rviz_visual_tools_demo
Code API
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.hpp>
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", node));
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::Isometry3d 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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
For more example code see rviz_visual_tools_demo.cpp
Rviz GUI Usage
NOT PORTED
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
NOT PORTED
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
NOT PORTED
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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
- publishText
- publishTest
And more…
Helper Functions
Reset function
-
deleteMarker(std::string namespace, std::size_t id)
- tells Rviz to clear a specific marker from being displayed. -
deleteAllMarkers()
- tells Rviz to clear out all current markers from being displayed.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
ros2 launch rviz_visual_tools demo_rviz.launch.py
ros2 run rviz_visual_tools rviz_visual_tools_imarker_simple_demo
TF Visual Tools
This tool lets you easily debug Eigen transforms in Rviz. Demo use:
rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Isometry3d world_to_shelf_transform = Eigen::Isometry3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");
Note: this is a work in progress
Testing and Linting
ROSlint is now run as a ROS test which can be run with the the following commands from your workspace directory (eg: ./ws_ros2).
catkin build --packages-select rviz_visual_tools
catkin test --packages-select rviz_visual_tools
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=$COLCON_WS/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" picknik/rviz_visual_tools:${ROS_DISTRO}
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t picknik/rviz_visual_tools:${ROS_DISTRO} .
Contribute
Please send PRs for new helper functions, fixes, etc!
When a pull request is opened, a reviewer is randomly assigned from the reviewer list using the Auto Assign Github Bot
Changelog for package rviz_visual_tools
4.0.3 (2021-12-13)
- Make sure to add all dependencies to the package.xml (#209) (#214)
- Backport Fix faulty templated constructor (#213)
- Contributors: Vatan Aksoy Tezer, Chris Lalancette
4.0.2 (2021-10-07)
- Add pluginlib dependency. (#203)
- Re-enable RemoteControl functionality
(#204)
- use condition_variable to be more thread safe
- Drop executor from constructor, deprecate old one
- Fix RemoteControl usage in demo
- Use SystemDefaultsQOS for RemoteControl subscriber
- Add RvizVisualToolsGui dashboard to rviz config, correct view
- Rename node_executable to executable (#201)
- Contributors: Davide Faconti, Henning Kayser, Jafar Abdi, Steven! Ragnarök, Vatan Aksoy Tezer
4.0.1 (2021-09-14)
- Remove executor namespace from rclcpp (#190)
- Fixes & improvements for deleting markers
(#188)
- Added RvizVisualTools method to delete all markers in a namespace
- Fixed deleteAllMarkers for all namespaces
- Added getters for marker ID's
- Move waitForSubscriber function to header file (#185)
- Create LICENSE (#183)
- Contributors: Jafar Abdi, Nathan Brooks, Vatan Aksoy Tezer, Wyatt Rees
4.0.0 (2021-04-09)
- Fix warning about deprecation (#180) rclcpp::executor::FutureReturnCode was removed
- Update to offer shared_ptr to create_timer
- Fix rviz_visual_tools_gui (#147)
- Compilation for Windows (#143)
- Remove stl file in preparation for LFS setup (#140)
- Add function deleteMarker: deletes marker for given namespace and id (#137)
- fix waitForSubscriber time (#142)
- Eloquent cleanup
(#135)
- some misc cleanup of the imarker simple lib
- actually reset marker counts
- changes for using IMarker simple as a library
- Fix rviz warnings about scale and uninitialized quaternions (#129)
- Normalize interactive marker quaternions. (#132)
- normalize before publish (#131)
- New helper function getIdentityPose() (#122)
- For ABCD planes: better comments, ensure the plane equation is satisfied. (#120) Co-Authored-By: Henning Kayser <<henningkayser@picknik.ai>>
- Make [rviz_visual_tools]{.title-ref} publish triangle mesh and
[tf_visual_tools]{.title-ref} clean published transforms
(#117)
- Add [clearAllTransform]{.title-ref} method to tf_visual_tools
- Add new function to publish mesh marker from triangles and vertices
- Publish plane from Ax+By+Cz+D=0 equation (#119)
- Fixed publishCylinder namespace (#109)
- Remove default arguments to make function calls not ambiguous (#112)
- Initialize quaternions in demo to avoid warning (#111)
- Fix node type in demo launch files (#110)
- Use LOGNAME for logging re:moveit styel (#106)
- Contributors: AndyZe, Bjar Ne, Dave Coleman, Jafar Abdi, Mike Lautman, Mori, MoriKen, Nathan Brooks, Sean Yen, Victor Lamoine, Yu Yan, d-walsh, hshose
3.7.0 (2018-11-26)
- Fix Eigen::Affine3d for Melodic (using Eigen::Isometry3d) (#105)
- Improve documentation (#100)
- Fix some catkin_lint warnings and rename targets output (#98)
- Update README Kinetic to Melodic (#102)
- Add Melodic build farm badges (#99)
- Add ccache support (#93)
- no ros::spinOnce() (#82)
- Deprecate old functions for ROS Melodic (#91)
- Improve package with catkin_lint (#89)
- Add OGRE dependency (#88)
- Automoc requires at least cmake version 2.8.6 (#86)
- Fix Travis badge (#84)
- The code already uses AUTOMOC (#76)
- Contributors: Dave Coleman, Jochen Sprickerhof, Michael Görner, Simon Schmeisser, Victor Lamoine
3.6.1 (2018-05-31)
- Actually link qt code into the gui library (#74)
- Contributors: Michael Goerner
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/rvt_test.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 3.6.0 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/davetcoleman/rviz_visual_tools.git |
VCS Type | git |
VCS Version | kinetic-devel |
Last Updated | 2019-02-23 |
Dev Status | DEVELOPED |
CI status | Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Dave Coleman
Authors
- Dave Coleman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.
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
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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
Rviz GUI Usage
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
roslaunch rviz_visual_tools demo_rviz.launch
rosrun rviz_visual_tools imarker_simple_demo
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");
Note: this is a work in progress
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
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=/home/dave/ros/current/ws_moveit/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" davetcoleman/rviz_visual_tools:kinetic
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t davetcoleman/rviz_visual_tools:kinetic .
Contribute
Please send PRs for new helper functions, fixes, etc!
Changelog for package rviz_visual_tools
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
catkin | |
rostest | |
rosunit | |
rviz | |
sensor_msgs | |
eigen_conversions | |
geometry_msgs | |
roscpp | |
tf_conversions | |
visualization_msgs | |
graph_msgs | |
std_msgs | |
trajectory_msgs | |
roslint | |
eigen_stl_containers |
System Dependencies
Name |
---|
libqt5x11extras5-dev |
Dependant Packages
Name | Deps |
---|---|
moveit_visual_tools |
Launch files
- launch/demo_rviz.launch
- launch/rvt_test.launch
-
- debug [default: false]
- launch/demo_combined.launch
-
- debug [default: false]
- launch/demo.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 2.2.0 |
License | BSD |
Build type | 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-08-06 |
Dev Status | DEVELOPED |
CI status | Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Dave Coleman
- Andy McEvoy
Authors
- Dave Coleman
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.
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
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
Docker Image
To build the docker image for this repo:
docker build -t davetcoleman/rviz_visual_tools:jade .
To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" davetcoleman/rviz_visual_tools:jade
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
Contribute
Please send PRs for new helper functions, fixes, etc!
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[XZ]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ñardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
eigen_conversions | |
geometry_msgs | |
roscpp | |
tf_conversions | |
visualization_msgs | |
graph_msgs | |
std_msgs | |
trajectory_msgs | |
cmake_modules | |
roslint | |
catkin | |
rostest | |
rosunit |
System Dependencies
Dependant Packages
Name | Deps |
---|---|
moveit_visual_tools | |
tf_keyboard_cal |
Launch files
- launch/demo_rviz.launch
- launch/rvt_test.launch
-
- debug [default: false]
- launch/demo_combined.launch
-
- debug [default: false]
- launch/demo.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 2.3.1 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/davetcoleman/rviz_visual_tools.git |
VCS Type | git |
VCS Version | indigo-devel |
Last Updated | 2017-11-13 |
Dev Status | DEVELOPED |
CI status | Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Dave Coleman
- Andy McEvoy
Authors
- Dave Coleman
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.
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
Or used combined roslaunch file:
roslaunch rviz_visual_tools demo_combined.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
Docker Image
To build the docker image for this repo:
docker build -t davetcoleman/rviz_visual_tools:indigo .
To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" davetcoleman/rviz_visual_tools:indigo
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
Contribute
Please send PRs for new helper functions, fixes, etc!
Changelog for package rviz_visual_tools
2.3.1 (2016-08-06)
- Clarified docs
- Contributors: Dave Coleman
2.3.0 (2016-08-06)
- Added Docker for Indigo
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE. (#47) This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
2.2.1 (2016-07-14)
- Latched publisher
- publishAxisLabeled arguments
- publishAxisLabeled arguments order
- Remove TODO msg
- Adds Publish Labeled Axis
- 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
- Hide debug message
- 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
- README
- Created much better demo, added new screenshot
- 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, Enrique Fernandez, Naveed Usmani
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[XZ]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ñardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
eigen_conversions | |
geometry_msgs | |
roscpp | |
tf_conversions | |
visualization_msgs | |
graph_msgs | |
std_msgs | |
trajectory_msgs | |
cmake_modules | |
roslint | |
catkin | |
rostest | |
rosunit |
System Dependencies
Dependant Packages
Name | Deps |
---|---|
moveit_visual_tools |
Launch files
- launch/demo_rviz.launch
- launch/rvt_test.launch
-
- debug [default: false]
- launch/demo_combined.launch
-
- debug [default: false]
- launch/demo.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 3.6.0 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/davetcoleman/rviz_visual_tools.git |
VCS Type | git |
VCS Version | kinetic-devel |
Last Updated | 2019-02-23 |
Dev Status | DEVELOPED |
CI status | Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Dave Coleman
Authors
- Dave Coleman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.
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
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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
Rviz GUI Usage
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
roslaunch rviz_visual_tools demo_rviz.launch
rosrun rviz_visual_tools imarker_simple_demo
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");
Note: this is a work in progress
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
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=/home/dave/ros/current/ws_moveit/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" davetcoleman/rviz_visual_tools:kinetic
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t davetcoleman/rviz_visual_tools:kinetic .
Contribute
Please send PRs for new helper functions, fixes, etc!
Changelog for package rviz_visual_tools
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
catkin | |
rostest | |
rosunit | |
rviz | |
sensor_msgs | |
eigen_conversions | |
geometry_msgs | |
roscpp | |
tf_conversions | |
visualization_msgs | |
graph_msgs | |
std_msgs | |
trajectory_msgs | |
roslint | |
eigen_stl_containers |
System Dependencies
Name |
---|
libqt5x11extras5-dev |
Dependant Packages
Launch files
- launch/demo_rviz.launch
- launch/rvt_test.launch
-
- debug [default: false]
- launch/demo_combined.launch
-
- debug [default: false]
- launch/demo.launch
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged rviz_visual_tools at Robotics Stack Exchange
rviz_visual_tools package from rviz_visual_tools reporviz_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 3.8.0 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/PickNikRobotics/rviz_visual_tools.git |
VCS Type | git |
VCS Version | melodic-devel |
Last Updated | 2020-06-09 |
Dev Status | MAINTAINED |
CI status |
|
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Dave Coleman
Authors
- Dave Coleman
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.
This package includes:
- Rviz Panel GUI to step through your code for debugging and testing
- Rviz-based keyboard control for stepping through application
- 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
- An interactive marker helper class
Developed by Dave Coleman at the Correll Robotics Lab, University of Colorado Boulder with help from Andy McEvoy and many others.
- Travis CI
- ROS Kinetic Buildfarm - AMD64 Xenial Debian Build for Ubuntu 16.04
- ROS Kinetic Buildfarm - AMD64 Xenial Devel Build for Ubuntu 16.04
- ROS Melodic Buildfarm - AMD64 Bionic Debian Build for Ubuntu 18.04
- ROS Melodic Buildfarm - AMD64 Bionic Devel Build for Ubuntu 18.04
Install
Ubuntu Debian
sudo apt-get install ros-melodic-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 melodic
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
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::Isometry3d 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);
// Don't forget to trigger the publisher!
visual_tools_->trigger();
For more example code see rviz_visual_tools_demo.cpp
Rviz GUI Usage
Publishes on the topic of /rviz_visual_tools_gui
The buttons in the Joy message correspond to the following:
1 - Next
2 - Continue
3 - Break
4 - Stop
Note: only Next is fully implemented
Mouse-Based Control
Use the Rviz panel called “RvizVisualToolsGui” to step through your program.
Keyboard-Based Control
Switch to the “KeyTool” in the top of the Rviz window and use the following keyboard commands:
- n: next
- c or a: continue
- b: break
- s: stop
API
Basic Publishing Functions
See rviz_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
- publishText
- publishTest
And more…
Helper Functions
Reset function
-
deleteAllMarkers()
- tells Rviz to clear out all current markers from being displayed.
All markers must be triggered after being published, by calling the trigger()
function. This allows batch publishing to be achieved by only calling after several markers have been created, greatly increasing the speed of your application. You can even explicitly tell rviz_visual_tools
how often to publish via the triggerEvery(NUM_MARKERS)
command:
- trigger()
- triggerEvery(20)
Conversion functions
- convertPose
- convertPoint32ToPose
- convertPoseToPoint
- convertPoint
- convertPoint32
- convertFromXYZRPY
- convertToXYZRPY
Convenience functions
- generateRandomPose
- generateEmptyPose
- dRand
- fRand
- iRand
- getCenterPoint
- getVectorBetweenPoints
Frame locking
This allows the markers to be automatically updated as the base frame moves without having to republish. You can enable it via enableFrameLocking()
(this is not enabled by default).
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
XXXXSMALL,
XXXSMALL,
XXSMALL,
XSMALL,
SMALL,
MEDIUM,
LARGE,
XLARGE,
XXLARGE,
XXXLARGE,
XXXXLARGE,
Interactive Marker Helper Class
This class quickly gives you basic 6dof pose interactive marker funcitonality. A demo is available:
roslaunch rviz_visual_tools demo_rviz.launch
rosrun rviz_visual_tools imarker_simple_demo
TF Visual Tools
This tool lets you easily debug Eigen transforms in Rviz. Demo use:
rviz_visual_tools::TFVisualTools tf_visualizer;
Eigen::Isometry3d world_to_shelf_transform = Eigen::Isometry3d::Identity(); // or whatever value
tf_visualizer.publishTransform(world_to_shelf_transform, "world", "shelf");
Note: this is a work in progress
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
Run with clang-tidy:
run-clang-tidy-4.0.py -clang-tidy-binary=/usr/lib/llvm-4.0/bin/clang-tidy -fix -p=/home/dave/ros/current/ws_moveit/build/rviz_visual_tools .
Docker Image
Dockerhub automatically creates a Docker for this repo. To run with GUI:
# This is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" davetcoleman/rviz_visual_tools:melodic
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
(Optional) To build the docker image locally for this repo, run in base of package:
docker build -t davetcoleman/rviz_visual_tools:melodic .
Contribute
Please send PRs for new helper functions, fixes, etc!
When a pull request is opened, a reviewer is randomly assigned from the reviewer list using the Auto Assign Github Bot
Changelog for package rviz_visual_tools
3.8.0 (2019-09-18)
- Windows bring up. (#116)
- Change email address (#114)
- Fixed publishCylinder namespace (#109)
- Remove default arguments to make function calls not ambiguous
(#112)
- Remove default arguments to make function calls not ambiguous
- Remove further default values
- Add unit tests for publishPath() functions, make sucess return value more stringent
- Initizalize quaternions in demo to avoid warning (#111)
- Fix node type in demo launch files (#110)
- Only auto-assign one reviewer (#107)
- Use LOGNAME for logging re:moveit styel (#106)
- Document Github Probot for Auto Assign (#101)
- Contributors: Dave Coleman, Sean Yen, Victor Lamoine, d-walsh
3.7.0 (2018-11-26)
- Fix Eigen::Affine3d for Melodic (using Eigen::Isometry3d) (#105)
- Improve documentation (#100)
- Fix some catkin_lint warnings and rename targets output (#98)
- Update README Kinetic to Melodic (#102)
- Add Melodic build farm badges (#99)
- Add ccache support (#93)
- no ros::spinOnce() (#82)
- Deprecate old functions for ROS Melodic (#91)
- Improve package with catkin_lint (#89)
- Add OGRE dependency (#88)
- Automoc requires at least cmake version 2.8.6 (#86)
- Fix Travis badge (#84)
- The code already uses AUTOMOC (#76)
- Contributors: Dave Coleman, Jochen Sprickerhof, Michael Görner, Simon Schmeisser, Victor Lamoine
3.6.1 (2018-05-31)
- Actually link qt code into the gui library (#74)
- Contributors: Michael Goerner
3.6.0 (2018-01-15)
- Addresses Issue #49 - Default Constructor Not Nodelet Friendly
- Added option to pass in a node handle in the constructor that defaults to
- Reset marker should publish initialized quaternion
- Improve code quality - add const, static, C++11 features, clang-format
- Create demo executable for IMarkerSimple
- Improve memory efficiency of functions
- Contributors: Dave Coleman, Geoffrey Chiou, Victor Lamoine
3.5.1 (2017-12-25)
- Normalize quaternion before storage
- Fix for ambiguous function call to publishAxis
- Add linking to visualization tools library for imarker_simple
- Added arrow pub to take two points
- Document clang-tidy
- catkin lint
- roslint applied
- Clang-format again
- Clang-tidy ALL
- C++11 optimizations
- Fix deprecated calls to convertFromXYZRPY
- Add new convertPoseSafe() function
- New convertFromXYZRPY() function to avoid deprecation warning
- Allow to enable frame locking in the markers/markers arrays
- Update license year
- IMarkerSimple: set name and pose
- New printTransformFull() function
- Removed deprecated warning
- New class for easily using 6dof imarkers
- More options to tf_visual_tools
- Update README.md
- Contributors: Andy McEvoy, Dave Coleman, Fadri Furrer, Victor Lamoine
3.4.1 (2017-06-20)
- Add dependency on QT5 for Ubuntu Zesty/Lunar support
- Allow publishPath with std_msgs::ColorRGBA
- Make INFO msg DEBUG
- Contributors: Dave Coleman, Victor Lamoine
3.4.0 (2016-11-02)
- Consolidated publishing into RemoteReciever class
- Improve console output
- Add RvizGui and KeyTool
- Enable remote control from withing rviz_visual_tools
- New publishPath() function
- Shorten number of lines printTranslation() requires
- Contributors: Dave Coleman
3.3.0 (2016-09-28)
- BREAKING CHANGE: Make batch publishing enabled by default
- Removed enableInternalBatchPublishing()
- Removed triggerInternalBatchPublishAndDisable()
- Deprecated triggerBatchPublish() in favor of function name trigger()
- Deprecated triggerBatchPublishAndDisable()
- Ability to trigger every x markers that are in queue, ideal in for loops
- New waitForMarkerPub() function that takes timeout
- Add std::move
- Added Docker for Kinetic
- Added delay to demo to allow rviz to load in Docker
- Change the sphere marker type from SPHERE_LIST to SPHERE - This makes irregularly scaled spheres (i.e. ellipsoids) to be rendered correctly.
- Contributors: Dave Coleman, Miguel Prada
3.2.0 (2016-07-14)
- Catkin depend on eigen and tf conversions
- New warning
- Added EulerConvention enum
- Added new convertFromXYZRPY() function
- Added new tests
- Contributors: Dave Coleman, Enrique Fernandez
3.1.0 (2016-07-06)
- Switched publishPath() to use cylinders
- Added new publishLineStrip() function
- Added new publishPath() functions
- Added new publishAxis() functions
- Update screenshot
- Broke publishPath() API for recent addition - incorrect Eigen vector used
- New publishPath() function for Affine3d
- New publishAxis() functions that use scale
- New publishAxisInternal() function for more efficient publishing
- New publishAxisPath() function for showing a series of coordinate axis
- Added warning for batch publishing when not enabled
- Bug fix in publishLines() for id incrementing
- New scaleToString() function
- Bug fix for scaling in coordinate axis
- Improved demo to have multiple scales visualized
- Revert "Remove graph msgs"
- Contributors: Dave Coleman
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[XZ]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 Canardo Alastuey
1.5.0 (2015-01-07)
- New publishLine function
- New publishText() function with Eigen pose
- New publishAxis() feature
- New publishRectangle() functions
- New publishCylinder() functions
- New convertPoint() functions
- API: Renamed publishTest() to publishTests()
- Fix CMakeLists
- API Break: Change TRANSLUCENT2 to TRANSLUCENT_LIGHT
- New convertPoint() function
- New DEFAULT color to allow color selection to be disabled
- Fix install space
- Fix for publishRectangle() - zero scale size
- Added new size const values
- Contributors: Dave Coleman
1.4.0 (2014-10-31)
- Renamed VisualTools to RvizVisualTools
- Removed unnecessary dependency
- Bugfix
- Reduced debug output
- New waitForSubscriber() function that checks for first subscriber to a publisher
- New generateEmptyPose() function helper
- Consolidated publishing rviz messages to central publishMarker() function
- Contributors: Dave Coleman
1.3.1 (2014-10-27)
- Added new publishSpheres function
- Renamed rviz_colors to colors and rviz_scales to scales
- Initial commit, forked from moveit_visual_tools
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
catkin | |
rostest | |
rosunit | |
rviz | |
sensor_msgs | |
eigen_conversions | |
geometry_msgs | |
roscpp | |
tf_conversions | |
visualization_msgs | |
graph_msgs | |
std_msgs | |
trajectory_msgs | |
roslint | |
eigen_stl_containers |
System Dependencies
Dependant Packages
Name | Deps |
---|---|
ainstein_radar_drivers | |
moveit_visual_tools |
Launch files
- launch/demo_rviz.launch
- launch/rvt_test.launch
-
- debug [default: false]
- launch/demo_combined.launch
-
- debug [default: false]
- launch/demo.launch
-
- debug [default: false]