PlanningSceneMonitor Subscribes to the topic planning_scene. More...
#include <planning_scene_monitor.h>
Classes | |
class | DynamicReconfigureImpl |
Public Types | |
enum | SceneUpdateType { UPDATE_NONE = 0, UPDATE_STATE = 1, UPDATE_TRANSFORMS = 2, UPDATE_GEOMETRY = 4, UPDATE_SCENE = 8 + UPDATE_STATE + UPDATE_TRANSFORMS + UPDATE_GEOMETRY } |
Public Member Functions | |
void | addUpdateCallback (const boost::function< void(SceneUpdateType)> &fn) |
Add a function to be called when an update to the scene is received. More... | |
void | clearOctomap () |
void | clearUpdateCallbacks () |
Clear the functions to be called when an update to the scene is received. More... | |
planning_scene::PlanningScenePtr | copyPlanningScene (const moveit_msgs::PlanningScene &diff=moveit_msgs::PlanningScene()) |
Returns a copy of the current planning scene. More... | |
double | getDefaultAttachedObjectPadding () const |
Get the default attached padding. More... | |
double | getDefaultObjectPadding () const |
Get the default object padding. More... | |
double | getDefaultRobotPadding () const |
Get the default robot padding. More... | |
double | getDefaultRobotScale () const |
Get the default robot scaling. More... | |
const ros::Time & | getLastUpdateTime () const |
Return the time when the last update was made to the planning scene (by any monitor) More... | |
void | getMonitoredTopics (std::vector< std::string > &topics) const |
Get the topic names that the monitor is listening to. More... | |
const std::string & | getName () const |
Get the name of this monitor. More... | |
const planning_scene::PlanningScenePtr & | getPlanningScene () |
Avoid this function! Returns an unsafe pointer to the current planning scene. More... | |
const planning_scene::PlanningSceneConstPtr & | getPlanningScene () const |
Avoid this function! Returns an unsafe pointer to the current planning scene. More... | |
double | getPlanningScenePublishingFrequency () const |
Get the maximum frequency at which planning scenes are published (Hz) More... | |
const std::string & | getRobotDescription () const |
Get the stored robot description. More... | |
const moveit::core::RobotModelConstPtr & | getRobotModel () const |
const robot_model_loader::RobotModelLoaderPtr & | getRobotModelLoader () const |
Get the user kinematic model loader. More... | |
const CurrentStateMonitorPtr & | getStateMonitor () const |
Get the stored instance of the stored current state monitor. More... | |
CurrentStateMonitorPtr & | getStateMonitorNonConst () |
double | getStateUpdateFrequency () const |
Get the maximum frequency (Hz) at which the current state of the planning scene is updated. More... | |
const std::shared_ptr< tf2_ros::Buffer > & | getTFClient () const |
Get the instance of the TF client that was passed to the constructor of this class. More... | |
void | lockSceneRead () |
Lock the scene for reading (multiple threads can lock for reading at the same time) More... | |
void | lockSceneWrite () |
Lock the scene for writing (only one thread can lock for writing and no other thread can lock for reading) More... | |
void | monitorDiffs (bool flag) |
By default, the maintained planning scene does not reason about diffs. When the flag passed in is true, the maintained scene starts counting diffs. Future updates to the planning scene will be stored as diffs and can be retrieved as such. Setting the flag to false restores the default behaviour. Maintaining diffs is automatically enabled when publishing planning scenes. More... | |
bool | newPlanningSceneMessage (const moveit_msgs::PlanningScene &scene) |
PlanningSceneMonitor (const planning_scene::PlanningScenePtr &scene, const robot_model_loader::RobotModelLoaderPtr &rml, const ros::NodeHandle &nh, const std::shared_ptr< tf2_ros::Buffer > &tf_buffer=std::shared_ptr< tf2_ros::Buffer >(), const std::string &name="") | |
Constructor. More... | |
PlanningSceneMonitor (const planning_scene::PlanningScenePtr &scene, const robot_model_loader::RobotModelLoaderPtr &rml, const std::shared_ptr< tf2_ros::Buffer > &tf_buffer=std::shared_ptr< tf2_ros::Buffer >(), const std::string &name="") | |
Constructor. More... | |
PlanningSceneMonitor (const planning_scene::PlanningScenePtr &scene, const std::string &robot_description, const std::shared_ptr< tf2_ros::Buffer > &tf_buffer=std::shared_ptr< tf2_ros::Buffer >(), const std::string &name="") | |
Constructor. More... | |
PlanningSceneMonitor (const robot_model_loader::RobotModelLoaderPtr &rml, const std::shared_ptr< tf2_ros::Buffer > &tf_buffer=std::shared_ptr< tf2_ros::Buffer >(), const std::string &name="") | |
Constructor. More... | |
PlanningSceneMonitor (const std::string &robot_description, const std::shared_ptr< tf2_ros::Buffer > &tf_buffer=std::shared_ptr< tf2_ros::Buffer >(), const std::string &name="") | |
Constructor. More... | |
void | providePlanningSceneService (const std::string &service_name=DEFAULT_PLANNING_SCENE_SERVICE) |
Create an optional service for getting the complete planning scene This is useful for satisfying the Rviz PlanningScene display's need for a service without having to use a move_group node. Be careful not to use this in conjunction with requestPlanningSceneState(), as it will create a pointless feedback loop. More... | |
void | publishDebugInformation (bool flag) |
bool | requestPlanningSceneState (const std::string &service_name=DEFAULT_PLANNING_SCENE_SERVICE) |
Request a full planning scene state using a service call Be careful not to use this in conjunction with providePlanningSceneService(), as it will create a pointless feedback loop. More... | |
void | setPlanningScenePublishingFrequency (double hz) |
Set the maximum frequency at which planning scenes are being published. More... | |
void | setStateUpdateFrequency (double hz) |
Update the scene using the monitored state at a specified frequency, in Hz. This function has an effect only when updates from the CurrentStateMonitor are received at a higher frequency. In that case, the updates are throttled down, so that they do not exceed a maximum update frequency specified here. More... | |
void | startPublishingPlanningScene (SceneUpdateType event, const std::string &planning_scene_topic=MONITORED_PLANNING_SCENE_TOPIC) |
Start publishing the maintained planning scene. The first message set out is a complete planning scene. Diffs are sent afterwards on updates specified by the event bitmask. For UPDATE_SCENE, the full scene is always sent. More... | |
void | startSceneMonitor (const std::string &scene_topic=DEFAULT_PLANNING_SCENE_TOPIC) |
Start the scene monitor (ROS topic-based) More... | |
void | startStateMonitor (const std::string &joint_states_topic=DEFAULT_JOINT_STATES_TOPIC, const std::string &attached_objects_topic=DEFAULT_ATTACHED_COLLISION_OBJECT_TOPIC) |
Start the current state monitor. More... | |
void | startWorldGeometryMonitor (const std::string &collision_objects_topic=DEFAULT_COLLISION_OBJECT_TOPIC, const std::string &planning_scene_world_topic=DEFAULT_PLANNING_SCENE_WORLD_TOPIC, const bool load_octomap_monitor=true) |
Start the OccupancyMapMonitor and listening for: More... | |
void | stopPublishingPlanningScene () |
Stop publishing the maintained planning scene. More... | |
void | stopSceneMonitor () |
Stop the scene monitor. More... | |
void | stopStateMonitor () |
Stop the state monitor. More... | |
void | stopWorldGeometryMonitor () |
Stop the world geometry monitor. More... | |
void | triggerSceneUpdateEvent (SceneUpdateType update_type) |
This function is called every time there is a change to the planning scene. More... | |
void | unlockSceneRead () |
Unlock the scene from reading (multiple threads can lock for reading at the same time) More... | |
void | unlockSceneWrite () |
Lock the scene from writing (only one thread can lock for writing and no other thread can lock for reading) More... | |
void | updateFrameTransforms () |
Update the transforms for the frames that are not part of the kinematic model using tf. Examples of these frames are the "map" and "odom_combined" transforms. This function is automatically called when data that uses transforms is received. However, this function should also be called before starting a planning request, for example. More... | |
void | updateSceneWithCurrentState (bool skip_update_if_locked=false) |
Update the scene using the monitored state. This function is automatically called when an update to the current state is received (if startStateMonitor() has been called). The updates are throttled to a maximum update frequency however, which is set by setStateUpdateFrequency(). More... | |
bool | updatesScene (const planning_scene::PlanningSceneConstPtr &scene) const |
Return true if the scene scene can be updated directly or indirectly by this monitor. This function will return true if the pointer of the scene is the same as the one maintained, or if a parent of the scene is the one maintained. More... | |
bool | updatesScene (const planning_scene::PlanningScenePtr &scene) const |
Return true if the scene scene can be updated directly or indirectly by this monitor. This function will return true if the pointer of the scene is the same as the one maintained, or if a parent of the scene is the one maintained. More... | |
bool | waitForCurrentRobotState (const ros::Time &t, double wait_time=1.) |
Wait for robot state to become more recent than time t. More... | |
~PlanningSceneMonitor () | |
Static Public Attributes | |
static const std::string | DEFAULT_ATTACHED_COLLISION_OBJECT_TOPIC = "attached_collision_object" |
The name of the topic used by default for attached collision objects. More... | |
static const std::string | DEFAULT_COLLISION_OBJECT_TOPIC = "collision_object" |
The name of the topic used by default for receiving collision objects in the world. More... | |
static const std::string | DEFAULT_JOINT_STATES_TOPIC = "joint_states" |
The name of the topic used by default for receiving joint states. More... | |
static const std::string | DEFAULT_PLANNING_SCENE_SERVICE = "get_planning_scene" |
The name of the service used by default for requesting full planning scene state. More... | |
static const std::string | DEFAULT_PLANNING_SCENE_TOPIC = "planning_scene" |
The name of the topic used by default for receiving full planning scenes or planning scene diffs. More... | |
static const std::string | DEFAULT_PLANNING_SCENE_WORLD_TOPIC = "planning_scene_world" |
static const std::string | MONITORED_PLANNING_SCENE_TOPIC = "monitored_planning_scene" |
Protected Types | |
using | AttachedBodyShapeHandles = std::map< const moveit::core::AttachedBody *, std::vector< std::pair< occupancy_map_monitor::ShapeHandle, std::size_t > > > |
using | CollisionBodyShapeHandles = std::map< std::string, std::vector< std::pair< occupancy_map_monitor::ShapeHandle, const Eigen::Isometry3d * > > > |
typedef std::map< const moveit::core::LinkModel *, std::vector< std::pair< occupancy_map_monitor::ShapeHandle, std::size_t > > > | LinkShapeHandles |
Protected Member Functions | |
void | attachObjectCallback (const moveit_msgs::AttachedCollisionObjectConstPtr &obj) |
Callback for a new attached object msg. More... | |
void | collisionObjectCallback (const moveit_msgs::CollisionObjectConstPtr &obj) |
Callback for a new collision object msg. More... | |
void | configureCollisionMatrix (const planning_scene::PlanningScenePtr &scene) |
Configure the collision matrix for a particular scene. More... | |
void | configureDefaultPadding () |
Configure the default padding. More... | |
void | currentStateAttachedBodyUpdateCallback (moveit::core::AttachedBody *attached_body, bool just_attached) |
Callback for a change for an attached object of the current state of the planning scene. More... | |
void | currentWorldObjectUpdateCallback (const collision_detection::World::ObjectConstPtr &object, collision_detection::World::Action action) |
Callback for a change in the world maintained by the planning scene. More... | |
void | excludeAttachedBodiesFromOctree () |
void | excludeAttachedBodyFromOctree (const moveit::core::AttachedBody *attached_body) |
void | excludeRobotLinksFromOctree () |
void | excludeWorldObjectFromOctree (const collision_detection::World::ObjectConstPtr &obj) |
void | excludeWorldObjectsFromOctree () |
bool | getShapeTransformCache (const std::string &target_frame, const ros::Time &target_time, occupancy_map_monitor::ShapeTransformCache &cache) const |
void | includeAttachedBodiesInOctree () |
void | includeAttachedBodyInOctree (const moveit::core::AttachedBody *attached_body) |
void | includeRobotLinksInOctree () |
void | includeWorldObjectInOctree (const collision_detection::World::ObjectConstPtr &obj) |
void | includeWorldObjectsInOctree () |
void | initialize (const planning_scene::PlanningScenePtr &scene) |
Initialize the planning scene monitor. More... | |
void | newPlanningSceneWorldCallback (const moveit_msgs::PlanningSceneWorldConstPtr &world) |
Callback for a new planning scene world. More... | |
void | octomapUpdateCallback () |
Callback for octomap updates. More... | |
Private Member Functions | |
bool | checkFrameIgnored (const std::string &frame) |
bool | getPlanningSceneServiceCallback (moveit_msgs::GetPlanningScene::Request &req, moveit_msgs::GetPlanningScene::Response &res) |
void | getUpdatedFrameTransforms (std::vector< geometry_msgs::TransformStamped > &transforms) |
void | newPlanningSceneCallback (const moveit_msgs::PlanningSceneConstPtr &scene) |
void | onStateUpdate (const sensor_msgs::JointStateConstPtr &joint_state) |
void | scenePublishingThread () |
void | stateUpdateTimerCallback (const ros::WallTimerEvent &event) |
Private Attributes | |
collision_detection::CollisionPluginLoader | collision_loader_ |
ros::WallDuration | dt_state_update_ |
the amount of time to wait in between updates to the robot state More... | |
std::set< std::string > | ignored_frames_ |
ros::WallTime | last_robot_state_update_wall_time_ |
Last time the state was updated from current_state_monitor_. More... | |
DynamicReconfigureImpl * | reconfigure_impl_ |
robot_model_loader::RobotModelLoaderPtr | rm_loader_ |
moveit::core::RobotModelConstPtr | robot_model_ |
ros::Duration | shape_transform_cache_lookup_wait_time_ |
the amount of time to wait when looking up transforms More... | |
boost::mutex | state_update_mutex_ |
std::atomic< bool > | state_update_pending_ |
True if current_state_monitor_ has a newer RobotState than scene_. More... | |
ros::WallTimer | state_update_timer_ |
timer for state updates. More... | |
PlanningSceneMonitor Subscribes to the topic planning_scene.
Definition at line 93 of file planning_scene_monitor.h.
|
protected |
Definition at line 560 of file planning_scene_monitor.h.
|
protected |
Definition at line 562 of file planning_scene_monitor.h.
|
protected |
Definition at line 558 of file planning_scene_monitor.h.
Definition at line 96 of file planning_scene_monitor.h.
planning_scene_monitor::PlanningSceneMonitor::PlanningSceneMonitor | ( | const std::string & | robot_description, |
const std::shared_ptr< tf2_ros::Buffer > & | tf_buffer = std::shared_ptr<tf2_ros::Buffer>() , |
||
const std::string & | name = "" |
||
) |
Constructor.
robot_description | The name of the ROS parameter that contains the URDF (in string format) |
tf_buffer | A pointer to a tf2_ros::Buffer |
name | A name identifying this planning scene monitor |
Definition at line 151 of file planning_scene_monitor.cpp.
planning_scene_monitor::PlanningSceneMonitor::PlanningSceneMonitor | ( | const robot_model_loader::RobotModelLoaderPtr & | rml, |
const std::shared_ptr< tf2_ros::Buffer > & | tf_buffer = std::shared_ptr<tf2_ros::Buffer>() , |
||
const std::string & | name = "" |
||
) |
Constructor.
rml | A pointer to a kinematic model loader |
tf_buffer | A pointer to a tf2_ros::Buffer |
name | A name identifying this planning scene monitor |
Definition at line 165 of file planning_scene_monitor.cpp.
planning_scene_monitor::PlanningSceneMonitor::PlanningSceneMonitor | ( | const planning_scene::PlanningScenePtr & | scene, |
const std::string & | robot_description, | ||
const std::shared_ptr< tf2_ros::Buffer > & | tf_buffer = std::shared_ptr<tf2_ros::Buffer>() , |
||
const std::string & | name = "" |
||
) |
Constructor.
scene | The scene instance to maintain up to date with monitored information |
robot_description | The name of the ROS parameter that contains the URDF (in string format) |
tf_buffer | A pointer to a tf2_ros::Buffer |
name | A name identifying this planning scene monitor |
Definition at line 157 of file planning_scene_monitor.cpp.
planning_scene_monitor::PlanningSceneMonitor::PlanningSceneMonitor | ( | const planning_scene::PlanningScenePtr & | scene, |
const robot_model_loader::RobotModelLoaderPtr & | rml, | ||
const std::shared_ptr< tf2_ros::Buffer > & | tf_buffer = std::shared_ptr<tf2_ros::Buffer>() , |
||
const std::string & | name = "" |
||
) |
Constructor.
scene | The scene instance to maintain up to date with monitored information |
rml | A pointer to a kinematic model loader |
tf_buffer | A pointer to a tf2_ros::Buffer |
name | A name identifying this planning scene monitor |
Definition at line 171 of file planning_scene_monitor.cpp.
planning_scene_monitor::PlanningSceneMonitor::PlanningSceneMonitor | ( | const planning_scene::PlanningScenePtr & | scene, |
const robot_model_loader::RobotModelLoaderPtr & | rml, | ||
const ros::NodeHandle & | nh, | ||
const std::shared_ptr< tf2_ros::Buffer > & | tf_buffer = std::shared_ptr<tf2_ros::Buffer>() , |
||
const std::string & | name = "" |
||
) |
Constructor.
scene | The scene instance to maintain up to date with monitored information |
rml | A pointer to a kinematic model loader |
nh | external parent NodeHandle The monitors will use this NodeHandle's CallbackQueue for updates. Usually, this should be a different queue than the global queue, otherwise you might run into timeouts. |
tf_buffer | A pointer to a tf2_ros::Buffer |
name | A name identifying this planning scene monitor |
Definition at line 183 of file planning_scene_monitor.cpp.
planning_scene_monitor::PlanningSceneMonitor::~PlanningSceneMonitor | ( | ) |
Definition at line 194 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::addUpdateCallback | ( | const boost::function< void(SceneUpdateType)> & | fn | ) |
Add a function to be called when an update to the scene is received.
Definition at line 1329 of file planning_scene_monitor.cpp.
|
protected |
Callback for a new attached object msg.
Definition at line 733 of file planning_scene_monitor.cpp.
|
private |
Definition at line 1493 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::clearOctomap | ( | ) |
Definition at line 589 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::clearUpdateCallbacks | ( | ) |
Clear the functions to be called when an update to the scene is received.
Definition at line 1336 of file planning_scene_monitor.cpp.
|
protected |
Callback for a new collision object msg.
Definition at line 718 of file planning_scene_monitor.cpp.
|
protected |
Configure the collision matrix for a particular scene.
Definition at line 1402 of file planning_scene_monitor.cpp.
|
protected |
Configure the default padding.
Definition at line 1445 of file planning_scene_monitor.cpp.
planning_scene::PlanningScenePtr planning_scene_monitor::PlanningSceneMonitor::copyPlanningScene | ( | const moveit_msgs::PlanningScene & | diff = moveit_msgs::PlanningScene() | ) |
Returns a copy of the current planning scene.
Definition at line 216 of file planning_scene_monitor.cpp.
|
protected |
Callback for a change for an attached object of the current state of the planning scene.
Definition at line 930 of file planning_scene_monitor.cpp.
|
protected |
Callback for a change in the world maintained by the planning scene.
Definition at line 942 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 814 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 851 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 747 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 890 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 842 of file planning_scene_monitor.cpp.
|
inline |
Get the default attached padding.
Definition at line 279 of file planning_scene_monitor.h.
|
inline |
Get the default object padding.
Definition at line 273 of file planning_scene_monitor.h.
|
inline |
Get the default robot padding.
Definition at line 261 of file planning_scene_monitor.h.
|
inline |
Get the default robot scaling.
Definition at line 267 of file planning_scene_monitor.h.
|
inline |
Return the time when the last update was made to the planning scene (by any monitor)
Definition at line 416 of file planning_scene_monitor.h.
void planning_scene_monitor::PlanningSceneMonitor::getMonitoredTopics | ( | std::vector< std::string > & | topics | ) | const |
Get the topic names that the monitor is listening to.
Definition at line 478 of file planning_scene_monitor.cpp.
|
inline |
Get the name of this monitor.
Definition at line 194 of file planning_scene_monitor.h.
|
inline |
Avoid this function! Returns an unsafe pointer to the current planning scene.
Definition at line 224 of file planning_scene_monitor.h.
|
inline |
Avoid this function! Returns an unsafe pointer to the current planning scene.
Definition at line 232 of file planning_scene_monitor.h.
|
inline |
Get the maximum frequency at which planning scenes are published (Hz)
Definition at line 310 of file planning_scene_monitor.h.
|
private |
Definition at line 569 of file planning_scene_monitor.cpp.
|
inline |
Get the stored robot description.
Definition at line 255 of file planning_scene_monitor.h.
|
inline |
Definition at line 205 of file planning_scene_monitor.h.
|
inline |
Get the user kinematic model loader.
Definition at line 200 of file planning_scene_monitor.h.
|
protected |
Definition at line 1063 of file planning_scene_monitor.cpp.
|
inline |
Get the stored instance of the stored current state monitor.
Definition at line 317 of file planning_scene_monitor.h.
|
inline |
Definition at line 322 of file planning_scene_monitor.h.
|
inline |
Get the maximum frequency (Hz) at which the current state of the planning scene is updated.
Definition at line 357 of file planning_scene_monitor.h.
|
inline |
Get the instance of the TF client that was passed to the constructor of this class.
Definition at line 285 of file planning_scene_monitor.h.
|
private |
List of callbacks to trigger when updates are received
Definition at line 1349 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 798 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 873 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 783 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 913 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 826 of file planning_scene_monitor.cpp.
|
protected |
Initialize the planning scene monitor.
scene | The scene instance to fill with data (an instance is allocated if the one passed in is not allocated) |
Definition at line 229 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::lockSceneRead | ( | ) |
Lock the scene for reading (multiple threads can lock for reading at the same time)
Definition at line 1012 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::lockSceneWrite | ( | ) |
Lock the scene for writing (only one thread can lock for writing and no other thread can lock for reading)
Definition at line 1026 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::monitorDiffs | ( | bool | flag | ) |
By default, the maintained planning scene does not reason about diffs. When the flag passed in is true, the maintained scene starts counting diffs. Future updates to the planning scene will be stored as diffs and can be retrieved as such. Setting the flag to false restores the default behaviour. Maintaining diffs is automatically enabled when publishing planning scenes.
Definition at line 313 of file planning_scene_monitor.cpp.
|
private |
Definition at line 584 of file planning_scene_monitor.cpp.
bool planning_scene_monitor::PlanningSceneMonitor::newPlanningSceneMessage | ( | const moveit_msgs::PlanningScene & | scene | ) |
Definition at line 612 of file planning_scene_monitor.cpp.
|
protected |
Callback for a new planning scene world.
Definition at line 694 of file planning_scene_monitor.cpp.
|
protected |
Callback for octomap updates.
Definition at line 1240 of file planning_scene_monitor.cpp.
|
private |
Definition at line 1221 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::providePlanningSceneService | ( | const std::string & | service_name = DEFAULT_PLANNING_SCENE_SERVICE | ) |
Create an optional service for getting the complete planning scene This is useful for satisfying the Rviz PlanningScene display's need for a service without having to use a move_group node. Be careful not to use this in conjunction with requestPlanningSceneState(), as it will create a pointless feedback loop.
service_name | The topic to provide the service |
Definition at line 562 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::publishDebugInformation | ( | bool | flag | ) |
Definition at line 1396 of file planning_scene_monitor.cpp.
bool planning_scene_monitor::PlanningSceneMonitor::requestPlanningSceneState | ( | const std::string & | service_name = DEFAULT_PLANNING_SCENE_SERVICE | ) |
Request a full planning scene state using a service call Be careful not to use this in conjunction with providePlanningSceneService(), as it will create a pointless feedback loop.
service_name | The name of the service to use for requesting the planning scene. This must be a service of type moveit_msgs::GetPlanningScene and is usually called "/get_planning_scene". |
Definition at line 529 of file planning_scene_monitor.cpp.
|
private |
Definition at line 389 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::setPlanningScenePublishingFrequency | ( | double | hz | ) |
Set the maximum frequency at which planning scenes are being published.
Definition at line 1342 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::setStateUpdateFrequency | ( | double | hz | ) |
Update the scene using the monitored state at a specified frequency, in Hz. This function has an effect only when updates from the CurrentStateMonitor are received at a higher frequency. In that case, the updates are throttled down, so that they do not exceed a maximum update frequency specified here.
hz | the update frequency. By default this is 33Hz. |
Definition at line 1264 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::startPublishingPlanningScene | ( | SceneUpdateType | event, |
const std::string & | planning_scene_topic = MONITORED_PLANNING_SCENE_TOPIC |
||
) |
Start publishing the maintained planning scene. The first message set out is a complete planning scene. Diffs are sent afterwards on updates specified by the event bitmask. For UPDATE_SCENE, the full scene is always sent.
Definition at line 376 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::startSceneMonitor | ( | const std::string & | scene_topic = DEFAULT_PLANNING_SCENE_TOPIC | ) |
Start the scene monitor (ROS topic-based)
scene_topic | The name of the planning scene topic |
Definition at line 1040 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::startStateMonitor | ( | const std::string & | joint_states_topic = DEFAULT_JOINT_STATES_TOPIC , |
const std::string & | attached_objects_topic = DEFAULT_ATTACHED_COLLISION_OBJECT_TOPIC |
||
) |
Start the current state monitor.
joint_states_topic | the topic to listen to for joint states |
attached_objects_topic | the topic to listen to for attached collision objects |
Definition at line 1179 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::startWorldGeometryMonitor | ( | const std::string & | collision_objects_topic = DEFAULT_COLLISION_OBJECT_TOPIC , |
const std::string & | planning_scene_world_topic = DEFAULT_PLANNING_SCENE_WORLD_TOPIC , |
||
const bool | load_octomap_monitor = true |
||
) |
Start the OccupancyMapMonitor and listening for:
collision_objects_topic | The topic on which to listen for collision objects |
planning_scene_world_topic | The topic to listen to for world scene geometry |
load_octomap_monitor | Flag to disable octomap monitor if desired |
Definition at line 1118 of file planning_scene_monitor.cpp.
|
private |
Definition at line 1232 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::stopPublishingPlanningScene | ( | ) |
Stop publishing the maintained planning scene.
Definition at line 362 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::stopSceneMonitor | ( | ) |
Stop the scene monitor.
Definition at line 1054 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::stopStateMonitor | ( | ) |
Stop the state monitor.
Definition at line 1210 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::stopWorldGeometryMonitor | ( | ) |
Stop the world geometry monitor.
Definition at line 1163 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::triggerSceneUpdateEvent | ( | SceneUpdateType | update_type | ) |
This function is called every time there is a change to the planning scene.
Definition at line 518 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::unlockSceneRead | ( | ) |
Unlock the scene from reading (multiple threads can lock for reading at the same time)
Definition at line 1019 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::unlockSceneWrite | ( | ) |
Lock the scene from writing (only one thread can lock for writing and no other thread can lock for reading)
Definition at line 1033 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::updateFrameTransforms | ( | ) |
Update the transforms for the frames that are not part of the kinematic model using tf. Examples of these frames are the "map" and "odom_combined" transforms. This function is automatically called when data that uses transforms is received. However, this function should also be called before starting a planning request, for example.
Definition at line 1378 of file planning_scene_monitor.cpp.
void planning_scene_monitor::PlanningSceneMonitor::updateSceneWithCurrentState | ( | bool | skip_update_if_locked = false | ) |
Update the scene using the monitored state. This function is automatically called when an update to the current state is received (if startStateMonitor() has been called). The updates are throttled to a maximum update frequency however, which is set by setStateUpdateFrequency().
skip_update_if_locked | causes the update to be skipped if the planning scene is locked. |
Definition at line 1289 of file planning_scene_monitor.cpp.
bool planning_scene_monitor::PlanningSceneMonitor::updatesScene | ( | const planning_scene::PlanningSceneConstPtr & | scene | ) | const |
Return true if the scene scene can be updated directly or indirectly by this monitor. This function will return true if the pointer of the scene is the same as the one maintained, or if a parent of the scene is the one maintained.
Definition at line 513 of file planning_scene_monitor.cpp.
bool planning_scene_monitor::PlanningSceneMonitor::updatesScene | ( | const planning_scene::PlanningScenePtr & | scene | ) | const |
Return true if the scene scene can be updated directly or indirectly by this monitor. This function will return true if the pointer of the scene is the same as the one maintained, or if a parent of the scene is the one maintained.
Definition at line 508 of file planning_scene_monitor.cpp.
bool planning_scene_monitor::PlanningSceneMonitor::waitForCurrentRobotState | ( | const ros::Time & | t, |
double | wait_time = 1. |
||
) |
Wait for robot state to become more recent than time t.
If there is no state monitor active, there will be no scene updates. Hence, you can specify a timeout to wait for those updates. Default is 1s.
Definition at line 961 of file planning_scene_monitor.cpp.
|
protected |
Definition at line 565 of file planning_scene_monitor.h.
|
protected |
Definition at line 543 of file planning_scene_monitor.h.
|
protected |
Definition at line 566 of file planning_scene_monitor.h.
|
private |
Definition at line 621 of file planning_scene_monitor.h.
|
protected |
Definition at line 544 of file planning_scene_monitor.h.
|
protected |
Definition at line 554 of file planning_scene_monitor.h.
|
static |
The name of the topic used by default for attached collision objects.
Definition at line 119 of file planning_scene_monitor.h.
|
protected |
default attached padding
Definition at line 525 of file planning_scene_monitor.h.
|
static |
The name of the topic used by default for receiving collision objects in the world.
Definition at line 122 of file planning_scene_monitor.h.
|
static |
The name of the topic used by default for receiving joint states.
Definition at line 116 of file planning_scene_monitor.h.
|
protected |
default object padding
Definition at line 523 of file planning_scene_monitor.h.
|
static |
The name of the service used by default for requesting full planning scene state.
Definition at line 132 of file planning_scene_monitor.h.
|
static |
The name of the topic used by default for receiving full planning scenes or planning scene diffs.
Definition at line 129 of file planning_scene_monitor.h.
|
static |
The name of the topic used by default for receiving geometry information about a planning scene (complete overwrite of world geometry)
Definition at line 126 of file planning_scene_monitor.h.
|
protected |
default robot link padding
Definition at line 527 of file planning_scene_monitor.h.
|
protected |
default robot link scale
Definition at line 529 of file planning_scene_monitor.h.
|
protected |
default robot padding
Definition at line 519 of file planning_scene_monitor.h.
|
protected |
default robot scaling
Definition at line 521 of file planning_scene_monitor.h.
|
private |
the amount of time to wait in between updates to the robot state
Definition at line 606 of file planning_scene_monitor.h.
|
protected |
Definition at line 548 of file planning_scene_monitor.h.
|
private |
Definition at line 626 of file planning_scene_monitor.h.
|
protected |
Last time the state was updated.
Definition at line 507 of file planning_scene_monitor.h.
|
private |
Last time the state was updated from current_state_monitor_.
Definition at line 602 of file planning_scene_monitor.h.
|
protected |
mutex for stored scene
Definition at line 506 of file planning_scene_monitor.h.
|
protected |
Definition at line 564 of file planning_scene_monitor.h.
|
protected |
The name of this scene monitor.
Definition at line 500 of file planning_scene_monitor.h.
|
static |
The name of the topic used by default for publishing the monitored planning scene (this is without "/" in the name, so the topic is prefixed by the node name)
Definition at line 136 of file planning_scene_monitor.h.
|
protected |
Definition at line 536 of file planning_scene_monitor.h.
|
protected |
Definition at line 537 of file planning_scene_monitor.h.
|
protected |
Last time the robot has moved.
Definition at line 509 of file planning_scene_monitor.h.
|
protected |
Definition at line 551 of file planning_scene_monitor.h.
|
protected |
Definition at line 504 of file planning_scene_monitor.h.
|
protected |
Definition at line 532 of file planning_scene_monitor.h.
|
protected |
Definition at line 540 of file planning_scene_monitor.h.
|
protected |
Definition at line 541 of file planning_scene_monitor.h.
|
protected |
Definition at line 533 of file planning_scene_monitor.h.
|
protected |
Definition at line 534 of file planning_scene_monitor.h.
|
protected |
Definition at line 535 of file planning_scene_monitor.h.
|
protected |
Definition at line 511 of file planning_scene_monitor.h.
|
private |
Definition at line 623 of file planning_scene_monitor.h.
|
private |
Definition at line 618 of file planning_scene_monitor.h.
|
protected |
Definition at line 516 of file planning_scene_monitor.h.
|
private |
Definition at line 619 of file planning_scene_monitor.h.
|
protected |
Definition at line 510 of file planning_scene_monitor.h.
|
protected |
Definition at line 502 of file planning_scene_monitor.h.
|
protected |
Definition at line 503 of file planning_scene_monitor.h.
|
protected |
if diffs are monitored, this is the pointer to the parent scene
Definition at line 505 of file planning_scene_monitor.h.
|
mutableprotected |
Definition at line 567 of file planning_scene_monitor.h.
|
private |
the amount of time to wait when looking up transforms
Definition at line 611 of file planning_scene_monitor.h.
|
protected |
Definition at line 512 of file planning_scene_monitor.h.
|
private |
Definition at line 597 of file planning_scene_monitor.h.
|
private |
True if current_state_monitor_ has a newer RobotState than scene_.
Definition at line 594 of file planning_scene_monitor.h.
|
private |
timer for state updates.
Definition at line 616 of file planning_scene_monitor.h.
|
protected |
Definition at line 514 of file planning_scene_monitor.h.
|
protected |
Definition at line 571 of file planning_scene_monitor.h.
|
protected |
lock access to update_callbacks_
Definition at line 570 of file planning_scene_monitor.h.