ompl_visual_tools package from ompl_visual_tools repoompl_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 2.3.2 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/davetcoleman/ompl_visual_tools.git |
VCS Type | git |
VCS Version | jade-devel |
Last Updated | 2016-02-05 |
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
OMPL Visual Tools
The OMPL Visual Tools is a library for visualizing and debugging Open Motion Planning Library algorithms in Rviz.
Formally named ompl_rviz_viewer until August 2014, this project spun out of an internship at Willow Garage. Video
The ompl_visual_tools was originally develped for testing cost-based algorithms in a two dimensional space with a third dimension displayed as cost. The space is specified as a grey scale cost map image that can be passed in to the program. The lighter (closer to white) each pixel of the image is, the “higher the cost” is considered to be. Black is considered no cost. Additionally, absolute obstacles can be specified by defining a max limit to the cost, such that any value above that threshold is considered an obstacle.
This little program is similar to the OMPL.app that is distributed with OMPL, but instead uses RViz for visualization and is more streamlined for considering costs and experience-based planning.
Developed by Dave Coleman at the University of Colorado Boulder and Willow Garage
Status:
Install
Ubuntu Debian
sudo apt-get install ros-indigo-ompl-visual-tools
Build from Source
To build this package, git clone
this repo into a catkin workspace and be sure to install necessary dependencies by running the following command in the root of your catkin workspace:
rosdep install -y --from-paths src --ignore-src --rosdistro indigo
Code API
See Class Reference
Usage
This library can be integrated into your project to easily view a 2D, 3D or robot planning environment in Rviz.
First, load the visualizer:
// The visual tools for interfacing with Rviz
ompl_visual_tools::OmplVisualToolsPtr visual_tools_;
// Load the tool for displaying in Rviz
visual_tools_.reset(new ompl_visual_tools::OmplVisualTools(BASE_FRAME));
visual_tools_->setSpaceInformation(si_);
visual_tools_->setGlobalScale(100);
// Clear current rviz makers
visual_tools_->deleteAllMarkers();
Two Dimensions with optional cost map
To test with a 2D environment with a cost map:
// Cost in 2D
ompl::base::CostMap2DOptimizationObjectivePtr cost_map_;
cost_map_->max_cost_threshold_percent_ = max_cost_threshold_percent;
cost_map_->loadImage(image_path);
// Pass cost to visualizer
visual_tools_->setCostMap(cost_map_->cost_);
To view the cost map in Rviz:
visual_tools_->publishCostMap(cost_map_->image_);
To view the start and goal location:
visual_tools_->publishState(start, rviz_visual_tools::GREEN, rviz_visual_tools::XLARGE, "plan_start_goal");
visual_tools_->publishState(goal, rviz_visual_tools::ORANGE, rviz_visual_tools::XLARGE, "plan_start_goal");
To view the solution path:
// Interpolate solution
simple_setup_->getSolutionPath().interpolate();
// Show path
visual_tools_->publishPath( simple_setup_->getSolutionPath(), rviz_visual_tools::GREEN, 1.0, "final_solution");
And to see more of what the planner was doing:
// Visualize the explored space
visual_tools_->publishGraph(planner_data, rviz_visual_tools::ORANGE, 0.2, "tree");
// Visualize the sample locations
visual_tools_->publishSamples(planner_data);
MoveIt! Robot Planning
See moveit_visual_tools for more information about tools this class can use with MoveIt!. For OMPL-specific features:
First, set the state space that MoveIt! has chosen for your robot in OMPL:
// Create a state space describing our robot's planning group
ompl_interface::ModelBasedStateSpaceSpecification model_ss_spec(moveit_robot_model, joint_model_group);
const ompl_interface::JointModelStateSpaceFactory factory;
ompl_interface::ModelBasedStateSpacePtr model_state_space = factory.getNewStateSpace(model_ss_spec);
// Setup the state space
model_state_space->setup();
visual_tools_->setStateSpace(model_state_space);
Then you can publish the paths of various tips on a robot, as planned in OMPL:
std::vector<ompl::base::PlannerDataPtr> paths;
simple_setup.getAllPlannerDatas(paths);
// Get tip links for this setup
std::vector<const robot_model::LinkModel*> tips;
joint_model_group_->getEndEffectorTips(tips);
bool show_trajectory_animated = true;
visual_tools_->publishRobotPath(paths[0], joint_model_group, tips, show_trajectory_animated);
View in Rviz
Start Rviz using the included launch file:
roslaunch ompl_visual_tools ompl_rviz.launch
Demo planner with standard RRT:
rosrun ompl_visual_tools rrt_demo
To see optional parameters, pass in --help
argument. There are many options.
Note: To change the algorithm being used, manually edit the code
Cost Map Usage
A default cost map image will be used, located in the resources/ folder, for running the algorithm. Optionally one can pass in their own cost map image through a command line argument, as shown in the following example:
rosrun ompl_visual_tools rrt_demo cost_map.ppm
The image must be in the PPM “Netpbm color image” format. To convert a jpg, png or any other image into this format on Linux simply use the “convert” command, as shown in the following example:
sudo apt-get install convert
convert cost_map.png cost_map.ppm
In general, a 100x100 pixel image is a decent space size, and larger dimensions will require much more computational resources or may hang your computer. GIMP is a good editor for scaling images down.
TODO
- Remove PPM library and instead depend on OMPL’s version
Develop
You are encouraged to fork this package on GitHub and test your own cost-based planning algorithms using this visualizer!
Changelog for package ompl_visual_tools
2.3.2 (2016-01-13)
- Removed usage of publishSamples in demo
- Updated README
- Added travis support
- Contributors: Dave Coleman
2.3.1 (2015-12-07)
- catkin lint cleanup
- Contributors: Dave Coleman
2.3.0 (2015-12-05)
- Fixed API changes in rviz_visual_tools
- Contributors: Dave Coleman
2.2.1 (2015-01-07)
- Fix typo
- Added missing images
- Fix install space
- Contributors: Dave Coleman
2.2.0 (2014-10-31)
- Fix for RvizVisualTools
- Upgrade to new moveit_visual_tools API
- API changes for moveit_visual_tools
- Added gitignore
- New publishState() functions
- New publishRobotState function
- Formatting, new callback parameter
- Deprecated publishSamples functions
- Added publishSpheres functions to correspond to moveit_visual_tools ones
- Improved visualizationStateCallback
- New publishRobotGraph function
- New convertRobotStatesToTipPoints function
- Fixing display database mode
- Made publish functions return bool
- Disable 3D option
- publish cost map with non-static ID numbers
- New publishSampleIDs function. Restructured publishSamples interface to use moveit_visual_tools version
- Updated publishSampels() functions
- Reduced size of published spheres
- Contributors: Dave Coleman
2.1.1 (2014-08-11)
- Removed debug output
- Removed hard-coded base_frame name
- Improved memory usage
- Cost ptr bug fix
- Removed setOptimizationMethod()
- Contributors: Dave Coleman
2.1.0 (2014-08-08)
- Removed getSolutionPlannerName that is not available in OMPL released version
- Updated README
- Renamed file to rrt_demo.cpp
- Cleanup since change to moveit_visual_tools
- Specify OMPL version
- Fixed marker topic path
- Contributors: Dave Coleman
2.0.1 (2014-08-07)
- Updated README
- Removed lightning dependencies
- Renamed ompl_rviz_viewer to ompl_visual_tools
- Initial
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
graph_msgs | |
moveit_visual_tools | |
moveit_planners_ompl | |
moveit_core | |
roscpp | |
roslib | |
visualization_msgs | |
ompl | |
catkin |
System Dependencies
Dependant Packages
Launch files
- launch/ompl_rviz.launch
- -*- mode: XML -*-
-
- debug [default: false]
Messages
Services
Plugins
Recent questions tagged ompl_visual_tools at Robotics Stack Exchange
ompl_visual_tools package from ompl_visual_tools repoompl_visual_tools |
|
Package Summary
Tags | No category tags. |
Version | 2.3.2 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/davetcoleman/ompl_visual_tools.git |
VCS Type | git |
VCS Version | indigo-devel |
Last Updated | 2017-03-04 |
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
OMPL Visual Tools
The OMPL Visual Tools is a library for visualizing and debugging Open Motion Planning Library algorithms in Rviz.
Formally named ompl_rviz_viewer until August 2014, this project spun out of an internship at Willow Garage. Video
The ompl_visual_tools was originally develped for testing cost-based algorithms in a two dimensional space with a third dimension displayed as cost. The space is specified as a grey scale cost map image that can be passed in to the program. The lighter (closer to white) each pixel of the image is, the “higher the cost” is considered to be. Black is considered no cost. Additionally, absolute obstacles can be specified by defining a max limit to the cost, such that any value above that threshold is considered an obstacle.
This little program is similar to the OMPL.app that is distributed with OMPL, but instead uses RViz for visualization and is more streamlined for considering costs and experience-based planning.
Developed by Dave Coleman at the University of Colorado Boulder and Willow Garage
Status:
How to Build
sudo apt-get install ros-indigo-ompl-visual-tools
Usage
This library can be integrated into your project to easily view a 2D, 3D or robot planning environment in Rviz.
First, load the visualizer:
// The visual tools for interfacing with Rviz
ompl_visual_tools::OmplVisualToolsPtr visual_tools_;
// Load the tool for displaying in Rviz
visual_tools_.reset(new ompl_visual_tools::OmplVisualTools(BASE_FRAME));
visual_tools_->setSpaceInformation(si_);
visual_tools_->setGlobalScale(100);
// Clear current rviz makers
visual_tools_->deleteAllMarkers();
Two Dimensions with optional cost map
To test with a 2D environment with a cost map:
// Cost in 2D
ompl::base::CostMap2DOptimizationObjectivePtr cost_map_;
cost_map_->max_cost_threshold_percent_ = max_cost_threshold_percent;
cost_map_->loadImage(image_path);
// Pass cost to visualizer
visual_tools_->setCostMap(cost_map_->cost_);
To view the cost map in Rviz:
visual_tools_->publishCostMap(cost_map_->image_);
To view the start and goal location:
visual_tools_->publishState(start, rviz_visual_tools::GREEN, rviz_visual_tools::XLARGE, "plan_start_goal");
visual_tools_->publishState(goal, rviz_visual_tools::ORANGE, rviz_visual_tools::XLARGE, "plan_start_goal");
To view the solution path:
// Interpolate solution
simple_setup_->getSolutionPath().interpolate();
// Show path
visual_tools_->publishPath( simple_setup_->getSolutionPath(), rviz_visual_tools::GREEN, 1.0, "final_solution");
And to see more of what the planner was doing:
// Visualize the explored space
visual_tools_->publishGraph(planner_data, rviz_visual_tools::ORANGE, 0.2, "tree");
// Visualize the sample locations
visual_tools_->publishSamples(planner_data);
MoveIt! Robot Planning
See moveit_visual_tools for more information about tools this class can use with MoveIt!. For OMPL-specific features:
First, set the state space that MoveIt! has chosen for your robot in OMPL:
// Create a state space describing our robot's planning group
ompl_interface::ModelBasedStateSpaceSpecification model_ss_spec(moveit_robot_model, joint_model_group);
const ompl_interface::JointModelStateSpaceFactory factory;
ompl_interface::ModelBasedStateSpacePtr model_state_space = factory.getNewStateSpace(model_ss_spec);
// Setup the state space
model_state_space->setup();
visual_tools_->setStateSpace(model_state_space);
Then you can publish the paths of various tips on a robot, as planned in OMPL:
std::vector<ompl::base::PlannerDataPtr> paths;
simple_setup.getAllPlannerDatas(paths);
// Get tip links for this setup
std::vector<const robot_model::LinkModel*> tips;
joint_model_group_->getEndEffectorTips(tips);
bool show_trajectory_animated = true;
visual_tools_->publishRobotPath(paths[0], joint_model_group, tips, show_trajectory_animated);
View in Rviz
Start Rviz using the included launch file:
roslaunch ompl_visual_tools ompl_rviz.launch
Demo planner with standard RRT:
rosrun ompl_visual_tools rrt_demo
To see optional parameters, pass in --help
argument. There are many options.
Note: To change the algorithm being used, manually edit the code
Cost Map Usage
A default cost map image will be used, located in the resources/ folder, for running the algorithm. Optionally one can pass in their own cost map image through a command line argument, as shown in the following example:
rosrun ompl_visual_tools rrt_demo cost_map.ppm
The image must be in the PPM “Netpbm color image” format. To convert a jpg, png or any other image into this format on Linux simply use the “convert” command, as shown in the following example:
sudo apt-get install convert
convert cost_map.png cost_map.ppm
In general, a 100x100 pixel image is a decent space size, and larger dimensions will require much more computational resources or may hang your computer. GIMP is a good editor for scaling images down.
TODO
- Remove PPM library and instead depend on OMPL’s version
Develop
You are encouraged to fork this package on GitHub and test your own cost-based planning algorithms using this visualizer!
Changelog for package ompl_visual_tools
2.3.2 (2016-01-13)
- Removed usage of publishSamples in demo
- Updated README
- Added travis support
- Contributors: Dave Coleman
2.3.1 (2015-12-07)
- catkin lint cleanup
- Contributors: Dave Coleman
2.3.0 (2015-12-05)
- Fixed API changes in rviz_visual_tools
- Contributors: Dave Coleman
2.2.1 (2015-01-07)
- Fix typo
- Added missing images
- Fix install space
- Contributors: Dave Coleman
2.2.0 (2014-10-31)
- Fix for RvizVisualTools
- Upgrade to new moveit_visual_tools API
- API changes for moveit_visual_tools
- Added gitignore
- New publishState() functions
- New publishRobotState function
- Formatting, new callback parameter
- Deprecated publishSamples functions
- Added publishSpheres functions to correspond to moveit_visual_tools ones
- Improved visualizationStateCallback
- New publishRobotGraph function
- New convertRobotStatesToTipPoints function
- Fixing display database mode
- Made publish functions return bool
- Disable 3D option
- publish cost map with non-static ID numbers
- New publishSampleIDs function. Restructured publishSamples interface to use moveit_visual_tools version
- Updated publishSampels() functions
- Reduced size of published spheres
- Contributors: Dave Coleman
2.1.1 (2014-08-11)
- Removed debug output
- Removed hard-coded base_frame name
- Improved memory usage
- Cost ptr bug fix
- Removed setOptimizationMethod()
- Contributors: Dave Coleman
2.1.0 (2014-08-08)
- Removed getSolutionPlannerName that is not available in OMPL released version
- Updated README
- Renamed file to rrt_demo.cpp
- Cleanup since change to moveit_visual_tools
- Specify OMPL version
- Fixed marker topic path
- Contributors: Dave Coleman
2.0.1 (2014-08-07)
- Updated README
- Removed lightning dependencies
- Renamed ompl_rviz_viewer to ompl_visual_tools
- Initial
- Contributors: Dave Coleman
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
graph_msgs | |
moveit_visual_tools | |
moveit_planners_ompl | |
moveit_core | |
roscpp | |
roslib | |
visualization_msgs | |
ompl | |
catkin |
System Dependencies
Dependant Packages
Name | Deps |
---|---|
iri_wam_moveit_config |
Launch files
- launch/ompl_rviz.launch
- -*- mode: XML -*-
-
- debug [default: false]