### Install Rviz Visual Tools (Source) Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Clone the repository into a catkin workspace and use rosdep to install dependencies. Adjust the ROS distro as needed. ```bash rosdep install --from-paths src --ignore-src --rosdistro melodic ``` -------------------------------- ### Launch Rviz Visual Tools Demo Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Launch Rviz and the demo to see random shapes generated in Rviz. Ensure Rviz is running before starting the demo. ```bash roslaunch rviz_visual_tools demo_rviz.launch ``` ```bash roslaunch rviz_visual_tools demo.launch ``` -------------------------------- ### Run roslint with catkin-tools Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Use this command to run roslint for the current package with catkin-tools. Ensure roslint is installed. ```bash catkin build --no-status --no-deps --this --make-args roslint ``` -------------------------------- ### Install Rviz Visual Tools (Debian) Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Use this command to install the Rviz Visual Tools package on Ubuntu Debian systems. ```bash sudo apt-get install ros-melodic-rviz-visual-tools ``` -------------------------------- ### Run clang-tidy with fix flag Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Use this command to run clang-tidy with the fix flag to automatically correct code style issues. Ensure clang-tidy is installed and the path is correct. ```bash 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 . ``` -------------------------------- ### Build Docker Image Locally Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Build the Docker image for rviz_visual_tools locally. Run this command from the base of the package directory. ```bash docker build -t davetcoleman/rviz_visual_tools:melodic . ``` -------------------------------- ### Initialize RvizVisualTools Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Initialize the RvizVisualTools pointer in your class constructor. Specify the robot's base frame and the Rviz marker topic name. ```cpp visual_tools_.reset(new rviz_visual_tools::RvizVisualTools("base_frame","/rviz_visual_markers")); ``` -------------------------------- ### Run Rviz Visual Tools Docker Image Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md This command runs the rviz_visual_tools Docker image with GUI support. It temporarily disables X server access control for convenience, which is not recommended for production environments. Remember to close the security hole afterwards. ```bash # 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 ``` -------------------------------- ### Run catkin lint with catkin-tools Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Execute catkin lint with a warning level of 2 using catkin-tools. This helps identify potential issues in your package's build system. ```bash catkin lint -W2 ``` -------------------------------- ### Run tests with catkin-tools Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md This command runs the available tests for the current package without dependencies, using catkin-tools. The -i flag enables isolated testing. ```bash catkin run_tests --no-deps --this -i ``` -------------------------------- ### Create and Publish Pose with Arrow Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Creates a pose with a specified translation and rotation, then publishes it as a red, large arrow for visualization in Rviz. Ensure your Rviz fixed frame matches the one in the code. ```C++ // 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(); ``` -------------------------------- ### Helper Functions Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Utility functions for managing Rviz markers and manipulating poses and points. ```APIDOC ## 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 ``` -------------------------------- ### Interactive Marker Helper Class Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Provides basic 6DOF pose interactive marker functionality. ```APIDOC ## 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 ``` -------------------------------- ### Include Rviz Visual Tools Header Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Add this include statement to your C++ source files to use the Rviz Visual Tools library. ```cpp #include ``` -------------------------------- ### TF Visual Tools Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md A tool for debugging Eigen transforms in Rviz. ```APIDOC ## 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* ``` -------------------------------- ### Basic Publishing Functions Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Functions for publishing various geometric primitives and visualizations to Rviz. These include spheres, arrows, cuboids, cones, planes, lines, paths, polygons, blocks, wireframes, axes, cylinders, meshes, and text. ```APIDOC ## 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... ``` -------------------------------- ### Publish Transform with TFVisualTools Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Publishes a transform between two frames using the TFVisualTools class for debugging purposes in Rviz. ```C++ 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"); ``` -------------------------------- ### Declare RvizVisualTools Pointer Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Declare a pointer to RvizVisualTools as a member variable in your class for visualizing objects in Rviz. ```cpp // For visualizing things in rviz rviz_visual_tools::RvizVisualToolsPtr visual_tools_; ``` -------------------------------- ### Frame Locking Source: https://github.com/picknikrobotics/rviz_visual_tools/blob/master/README.md Enables markers to be automatically updated as the base frame moves without requiring republishing. ```APIDOC ## 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). ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.