Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
planning_scene_utils::PlanningSceneEditor Class Reference

Class for creating, editing, and saving planning scenes. More...

#include <move_arm_utils.h>

Inheritance diagram for planning_scene_utils::PlanningSceneEditor:
Inheritance graph
[legend]

List of all members.

Classes

struct  IKController
 Struct containing the start and end 6DOF controllers for a specific motion plan request. More...
struct  SelectableObject
 Struct containing an interactive marker for 6DOF control, and another for selection. More...
struct  StateRegistry
 convenience class for keeping track of KinematicStates. This must be done, because if not all kinematic states are deleted before SendPlanningScene() is called, the environment server is liable to hang. More...

Public Types

enum  GeneratedShape { Box, Cylinder, Sphere }
 These kinds of shapes can be created by the editor. More...

Public Member Functions

void armHasStoppedMoving ()
 Called when the robot actually stops moving, following execution of the trajectory.
void attachedCollisionObjectInteractiveCallback (const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
void collisionObjectMovementCallback (const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
 called when a collision object is moved in rviz.
void collisionObjectSelectionCallback (const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
 called when a collision object is selected in rviz.
void controllerDoneCallback (const actionlib::SimpleClientGoalState &state, const control_msgs::FollowJointTrajectoryResultConstPtr &result)
 Called when the robot monitor detects that the robot has stopped following a trajectory.
std::string createCollisionObject (const std::string &name, geometry_msgs::Pose pose, GeneratedShape shape, float scaleX, float scaleY, float scaleZ, std_msgs::ColorRGBA color)
 creates an entirely new collision object and places it in the environment.
void createIKController (MotionPlanRequestData &data, PositionType type, bool rePose=true)
 creates a 6DOF control over the end effector of either the start or goal position of the given request.
void createIkControllersFromMotionPlanRequest (MotionPlanRequestData &data, bool rePose=true)
 creates both the start and goal 6DOF controls for the given request, but only if those are visible and editable.
void createJointMarkers (MotionPlanRequestData &data, planning_scene_utils::PositionType position)
 creates 1DOF controls for each of the joints of the given request and its start and end positions.
std::string createMeshObject (const std::string &name, geometry_msgs::Pose pose, const std::string &filename, const tf::Vector3 &scale, std_msgs::ColorRGBA color)
void createMotionPlanRequest (const planning_models::KinematicState &start_state, const planning_models::KinematicState &end_state, const std::string &group_name, const std::string &end_effector_name, const unsigned int &planning_scene_name, const bool fromRobotState, unsigned int &motionPlan_id_Out)
 Creates an entirely new motion plan request with the given parameters.
std::string createNewPlanningScene ()
 creates an entirely new, empty planning scene.
void deleteCollisionObject (std::string &name)
 Removes the collision object with the specified name from the world.
void deleteJointMarkers (MotionPlanRequestData &data, PositionType type)
 erases all the interactive 1DOF markers on the joints of the given request.
void deleteKinematicStates ()
 All kinematic states in the editor are kept track of, and must be deleted with this function before the planning scene can be sent to the environment server. Otherwise, the editor will hang.
void deleteMotionPlanRequest (const unsigned int &id, std::vector< unsigned int > &erased_trajectories)
 erases the given motion plan request and all its associated trajectories.
void deleteTrajectory (unsigned int mpr_id, unsigned int traj_id)
 erases the given trajectory from the trajectory map.
void executeTrajectory (const std::string &mpr_name, const std::string &traj_name)
 Creates orientation constraints from a given robot state.
void executeTrajectory (TrajectoryData &data)
 if real robot data is being used, this can be used to send a trajectory to the robot for execution.
bool filterTrajectory (MotionPlanRequestData &requestData, TrajectoryData &trajectory, unsigned int &filter_id)
 Calls the trajectory filter service on the given trajectory.
std::string generateNewCollisionObjectId ()
 generates a unique collision object id.
unsigned int generateNewPlanningSceneId ()
 generates a unique planning scene id.
bool getAllAssociatedMotionPlanRequests (const unsigned int id, std::vector< unsigned int > &ids, std::vector< std::string > &stages, std::vector< arm_navigation_msgs::MotionPlanRequest > &requests)
 loads motion plan requests associated with the given timestamp from the warehouse.
bool getAllAssociatedPausedStates (const unsigned int id, std::vector< ros::Time > &paused_times)
 loads all paused states from the warehouse associated with the given time stamp.
bool getAllAssociatedTrajectorySources (const unsigned int planning_id, const unsigned int mpr_id, std::vector< unsigned int > &trajectory_ids, std::vector< std::string > &trajectory_sources)
 loads all trajectory sources from the warehouse associated with the given time stamp.
bool getAllPlanningSceneTimes (std::vector< ros::Time > &planning_scene_times, std::vector< unsigned int > &planning_scene_ids)
 loads all planning scene times from the warehouse.
void getAllRobotStampedTransforms (const planning_models::KinematicState &state, std::vector< geometry_msgs::TransformStamped > &trans_vector, const ros::Time &stamp)
 gets TF data for the given kinematic state.
planning_environment::CollisionModelsgetCollisionModel ()
move_arm_warehouse::MoveArmWarehouseLoggerReadergetLoggerReader ()
void getMotionPlanningMarkers (visualization_msgs::MarkerArray &arr)
 Fills the given array with mesh markers associated with all motion plan requests.
bool getMotionPlanRequest (const ros::Time &time, const std::string &stage, arm_navigation_msgs::MotionPlanRequest &mpr, std::string &id, std::string &planning_scene_id)
 loads a specific motion plan request from the warehouse.
bool getPausedState (const unsigned int id, const ros::Time &paused_time, head_monitor_msgs::HeadMonitorFeedback &paused_state)
 loads a specific paused state from the warehouse
bool getPlanningSceneOutcomes (const unsigned int id, std::vector< std::string > &pipeline_stages, std::vector< arm_navigation_msgs::ArmNavigationErrorCodes > &error_codes, std::map< std::string, arm_navigation_msgs::ArmNavigationErrorCodes > &error_map)
 loads all the error codes associated with a particular planning scene from the warehouse.
planning_models::KinematicStategetRobotState ()
void getTrajectoryMarkers (visualization_msgs::MarkerArray &arr)
 Fills the given array with mesh markers associated with all trajectories.
bool hasTrajectory (const std::string &mpr_name, const std::string &traj_name) const
void IKControllerCallback (const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
 Called when a 6DOF interactive marker is altered in RVIZ.
void initMotionPlanRequestData (const unsigned int &planning_scene_id, const std::vector< unsigned int > &ids, const std::vector< std::string > &stages, const std::vector< arm_navigation_msgs::MotionPlanRequest > &requests)
 fills the motion_plan_map with new motion plan requests initialized with warehouse data.
void JointControllerCallback (const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
 Called when a 1DOF joint marker is altered in RVIZ.
void jointStateCallback (const sensor_msgs::JointStateConstPtr &joint_state)
 Called when the robot monitor detects a change in the robot state.
void jointTrajectoryControllerStateCallback (const pr2_controllers_msgs::JointTrajectoryControllerStateConstPtr &joint_state)
 Called when the arm controller has a state update.
void loadAllWarehouseData ()
 gets all the motion plan requests, trajectories, and planning scenes from the warehouse.
bool loadPlanningScene (const ros::Time &time, const unsigned int id)
 loads a particular planning scene from the warehouse
void lockScene ()
void makeInteractive1DOFRotationMarker (tf::Transform transform, tf::Vector3 axis, std::string name, std::string description, float scale=1.0f, float angle=0.0f)
 creates an interactive marker for rotation joint control.
void makeInteractive1DOFTranslationMarker (tf::Transform transform, tf::Vector3 axis, std::string name, std::string description, float scale=1.0f, float value=0.0f)
 creates an interactive marker for prismatic joint control.
void makeSelectableAttachedObjectFromPlanningScene (const arm_navigation_msgs::PlanningScene &scene, arm_navigation_msgs::AttachedCollisionObject &att)
virtual void onPlanningSceneLoaded (int scene, int numScenes)
 pure virtual function that acts as a callback when a given scene was loaded. (Use case: things like loading bars)
 PlanningSceneEditor ()
 PlanningSceneEditor (PlanningSceneParameters &params)
bool planToKinematicState (const planning_models::KinematicState &state, const std::string &group_name, const std::string &end_effector_name, unsigned int &trajectoryid_Out, unsigned int &planning_scene_id)
 invokes the planner service to plan from the current robot state to the given kinematic state.
bool planToRequest (MotionPlanRequestData &data, unsigned int &trajectoryid_Out)
 invokes the planner to plan from the start position of the request to the goal position.
bool planToRequest (const std::string &requestid, unsigned int &trajectoryid_Out)
 invokes the planner to plan from the start position of the request to the goal position.
bool playTrajectory (MotionPlanRequestData &requestData, TrajectoryData &data)
 non-blocking call resetting the given trajectory and setting it to play and be visible.
void printTrajectoryPoint (const std::vector< std::string > &joint_names, const std::vector< double > &joint_values)
 for debugging, prints the given trajectory point values.
void randomlyPerturb (MotionPlanRequestData &mpr, PositionType type)
 sets the motion plan request start or goal to a set of random joint values. Avoids collisions
interactive_markers::MenuHandler::EntryHandle registerMenuEntry (std::string menu, std::string entryName, interactive_markers::MenuHandler::FeedbackCallback &callback)
 creates an interactive marker menu with the given name, associating it with a callback function.
interactive_markers::MenuHandler::EntryHandle registerSubMenuEntry (std::string menu, std::string name, std::string subMenu, interactive_markers::MenuHandler::FeedbackCallback &callback)
 registers a new menu entry as a sub menu of an exitsting interactive marker menu entry
void savePlanningScene (PlanningSceneData &data, bool copy=false)
 Pushes the given planning scene to the warehouse with ros::WallTime::now() as its timestamp.
void sendMarkers ()
 sends all stored mesh and sphere markers for collisions and links to rviz.
bool sendPlanningScene (PlanningSceneData &data)
 sends a planning scene diff message to the environment server, updating the global planning scene.
void sendTransformsAndClock ()
 sends all TF transforms and a wall clock time to ROS.
void setCollisionModel (planning_environment::CollisionModels *model, bool shouldDelete=false)
void setCurrentPlanningScene (std::string id, bool loadRequests=true, bool loadTrajectories=true)
 loads the given planning scene from the warehouse.
void setIKControlsVisible (std::string id, PositionType type, bool visible)
 either shows or hides the 6DOF interactive markers associated with the given request.
void setJointState (MotionPlanRequestData &data, PositionType position, std::string &jointName, tf::Transform value)
 attempts to set the state of the given joint in the given motion plan request so that it matches the given transform.
void setLoggerReader (move_arm_warehouse::MoveArmWarehouseLoggerReader *loggerReader, bool shouldDelete=true)
void setRobotState (planning_models::KinematicState *robot_state, bool shouldDelete=true)
bool solveIKForEndEffectorPose (MotionPlanRequestData &mpr, PositionType type, bool coll_aware=true, double change_redundancy=0.0)
 invokes the inverse kinematics solver on the given motion plan requests' start or end state, setting the joint values of that state to the solution.
void unlockScene ()
void updateJointStates ()
 if robot data is not being used, publishes fake joint states of the current robot state to a robot state publisher node.
 ~PlanningSceneEditor ()

Public Attributes

std::map< std::string, booljoint_clicked_map_
 Map of joint controls and whether they have been clicked by the user.
std::map< std::string,
tf::Transform
joint_prev_transform_map_
 Map of joint controls and their last transforms.
std::map< std::string,
MotionPlanRequestData
motion_plan_map_
 Map containing all motion plan requests, indexed by (unique) name.
std::map< std::string,
PlanningSceneData
planning_scene_map_
 Map containing all planning scenes, indexed by (unique) name.
std::map< std::string,
std::map< std::string,
TrajectoryData > > 
trajectory_map_
 Map containing all trajectories, indexed by (unique) motion plan id name, and then by unique trajectory name.

Protected Types

enum  MonitorStatus { idle, Executing, WaitingForStop, Done }
 PlanningSceneEditor monitors robot state while "use_robot_data_" is true. When in idle mode, the monitor is not recording robot state into a trajectory. In Executing mode, the monitor records to a trajectory. In Done mode, the final trajectory is saved to the trajectory map. More...

Protected Member Functions

void attachCollisionObject (const std::string &name, const std::string &link_name, const std::vector< std::string > &touch_links)
virtual void attachObjectCallback (const std::string &name)=0
void changeToAttached (const std::string &name)
void createSelectableMarkerFromCollisionObject (arm_navigation_msgs::CollisionObject &object, std::string name, std::string description, std_msgs::ColorRGBA color, bool insert_selectable=true)
 Registers a collision object as a selectable marker.
virtual void filterCallback (arm_navigation_msgs::ArmNavigationErrorCodes &errorCode)=0
 Virtual function called when the filter is invoked.
virtual void planCallback (arm_navigation_msgs::ArmNavigationErrorCodes &errorCode)=0
 Virtual function called when the planner is invoked.
virtual void selectedTrajectoryCurrentPointChanged (unsigned int new_current_point)
 Called when the selected trajectory of the selected motion plan updates its current point. Override to do something useful.
virtual void updateState ()
 Pure virtual function called when a trajectory, motion plan request, or the robot's state is changed.

Protected Attributes

int active_planner_index_
std::map< std::string,
actionlib::SimpleActionClient
< control_msgs::FollowJointTrajectoryAction > * > 
arm_controller_map_
interactive_markers::MenuHandler::FeedbackCallback attached_collision_object_feedback_ptr_
ros::Publisher clock_publisher_
planning_environment::CollisionModelscm_
std::map< std::string,
ros::ServiceClient * > * 
collision_aware_ik_services_
std::string collision_marker_state_
visualization_msgs::MarkerArray collision_markers_
interactive_markers::MenuHandler::FeedbackCallback collision_object_movement_feedback_ptr_
interactive_markers::MenuHandler::FeedbackCallback collision_object_selection_feedback_ptr_
ros::ServiceClient collision_proximity_planner_client_
std::string current_planning_scene_name_
ros::ServiceClient distance_aware_service_client_
ros::ServiceClient distance_state_validity_service_client_
std::map< std::string,
arm_navigation_msgs::ArmNavigationErrorCodes
error_map_
ros::ServiceClient gazebo_joint_state_client_
ros::ServiceClient get_link_properties_client_
interactive_markers::MenuHandler::FeedbackCallback ik_control_feedback_ptr_
std::map< std::string,
IKController > * 
ik_controllers_
interactive_markers::InteractiveMarkerServerinteractive_marker_server_
std::map< std::string,
ros::ServiceClient * > * 
interpolated_ik_services_
interactive_markers::MenuHandler::FeedbackCallback joint_control_feedback_ptr_
ros::Publisher joint_state_publisher_
ros::Subscriber joint_state_subscriber_
ros::Subscriber l_arm_controller_state_subscriber_
std_msgs::ColorRGBA last_collision_object_color_
arm_navigation_msgs::ArmNavigationErrorCodes last_collision_set_error_code_
std::vector< ros::Timelast_creation_time_query_
ros::Time last_marker_start_time_
std_msgs::ColorRGBA last_mesh_object_color_
interactive_markers::MenuHandler::EntryHandle last_resize_handle_
ros::ServiceClient left_ik_service_client_
ros::ServiceClient left_interpolate_service_client_
ros::ServiceClient list_controllers_client_
ros::ServiceClient load_controllers_client_
boost::recursive_mutex lock_scene_
std::string logged_group_name_
std::string logged_motion_plan_request_
trajectory_msgs::JointTrajectory logged_trajectory_
trajectory_msgs::JointTrajectory logged_trajectory_controller_error_
int logged_trajectory_controller_error_code_
ros::Time logged_trajectory_start_time_
ros::Duration marker_dt_
unsigned int max_collision_object_id_
unsigned int max_trajectory_id_
std::map< std::string,
MenuEntryMap
menu_entry_maps_
MenuHandlerMap menu_handler_map_
MonitorStatus monitor_status_
move_arm_warehouse::MoveArmWarehouseLoggerReadermove_arm_warehouse_logger_reader_
ros::NodeHandle nh_
ros::ServiceClient non_coll_left_ik_service_client_
ros::ServiceClient non_coll_right_ik_service_client_
std::map< std::string,
ros::ServiceClient * > * 
non_collision_aware_ik_services_
PlanningSceneParameters params_
ros::ServiceClient pause_gazebo_client_
planning_models::KinematicStatepaused_collision_state_
ros::ServiceClient planning_1_service_client_
ros::ServiceClient planning_2_service_client_
std_msgs::ColorRGBA point_color_
ros::Subscriber r_arm_controller_state_subscriber_
ros::ServiceClient right_ik_service_client_
ros::ServiceClient right_interpolate_service_client_
planning_models::KinematicStaterobot_state_
std::map< std::string, double > robot_state_joint_values_
std::vector
< geometry_msgs::TransformStamped > 
robot_transforms_
std::map< std::string,
SelectableObject > * 
selectable_objects_
std::string selected_motion_plan_name_
std::string selected_trajectory_name_
bool send_collision_markers_
ros::ServiceClient set_link_properties_client_
ros::ServiceClient set_planning_scene_diff_client_
std::vector< StateRegistrystates_
ros::ServiceClient switch_controllers_client_
ros::Time time_of_controller_done_callback_
ros::Time time_of_last_moving_notification_
ros::ServiceClient trajectory_filter_1_service_client_
ros::ServiceClient trajectory_filter_2_service_client_
tf::TransformBroadcaster transform_broadcaster_
tf::TransformListener transform_listener_
ros::ServiceClient unload_controllers_client_
ros::ServiceClient unpause_gazebo_client_
bool use_primary_filter_
ros::Publisher vis_marker_array_publisher_
ros::Publisher vis_marker_publisher_
bool warehouse_data_loaded_once_

Detailed Description

Class for creating, editing, and saving planning scenes.

Class PlanningSceneEditor

Definition at line 1339 of file move_arm_utils.h.


Member Enumeration Documentation

These kinds of shapes can be created by the editor.

Enum GeneratedShape

Enumerator:
Box 
Cylinder 
Sphere 

Definition at line 1346 of file move_arm_utils.h.

PlanningSceneEditor monitors robot state while "use_robot_data_" is true. When in idle mode, the monitor is not recording robot state into a trajectory. In Executing mode, the monitor records to a trajectory. In Done mode, the final trajectory is saved to the trajectory map.

Enum MonitorStatus

Enumerator:
idle 
Executing 
WaitingForStop 
Done 

Definition at line 1360 of file move_arm_utils.h.


Constructor & Destructor Documentation

Definition at line 703 of file move_arm_utils.cpp.

Memory initialization

Interactive markers

Publishers

Subscribers

Interactive menus

Connection with sim data

Connection with joint controller

Definition at line 720 of file move_arm_utils.cpp.

Definition at line 1127 of file move_arm_utils.cpp.


Member Function Documentation

Called when the robot actually stops moving, following execution of the trajectory.

Definition at line 4277 of file move_arm_utils.cpp.

void PlanningSceneEditor::attachCollisionObject ( const std::string &  name,
const std::string &  link_name,
const std::vector< std::string > &  touch_links 
) [protected]

Definition at line 3580 of file move_arm_utils.cpp.

void PlanningSceneEditor::attachedCollisionObjectInteractiveCallback ( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &  feedback)

Definition at line 3435 of file move_arm_utils.cpp.

virtual void planning_scene_utils::PlanningSceneEditor::attachObjectCallback ( const std::string &  name) [protected, pure virtual]
void PlanningSceneEditor::changeToAttached ( const std::string &  name) [protected]

Definition at line 3422 of file move_arm_utils.cpp.

void PlanningSceneEditor::collisionObjectMovementCallback ( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &  feedback)

called when a collision object is moved in rviz.

Parameters:
feedbackthe change that occurred to the collision object.

Definition at line 3298 of file move_arm_utils.cpp.

void PlanningSceneEditor::collisionObjectSelectionCallback ( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &  feedback)

called when a collision object is selected in rviz.

Parameters:
feedbackthe change that occurred to the collision object.

Definition at line 3256 of file move_arm_utils.cpp.

Called when the robot monitor detects that the robot has stopped following a trajectory.

Parameters:
statethe goal of the trajectory.
resultwhat the controller did while executing the trajectory.

Definition at line 4249 of file move_arm_utils.cpp.

std::string PlanningSceneEditor::createCollisionObject ( const std::string &  name,
geometry_msgs::Pose  pose,
PlanningSceneEditor::GeneratedShape  shape,
float  scaleX,
float  scaleY,
float  scaleZ,
std_msgs::ColorRGBA  color 
)

creates an entirely new collision object and places it in the environment.

Parameters:
posethe position and orientation of the object
shapethe type of object to create (Box, Cylinder, etc.)
scaleXthe size of the object in the x direction in meters.
scaleYthe size of the object in the y direction in meters.
scaleZthe size of the object in the z direction in meters.
colorthe color of the collision object.
Returns:
the unique id of the collision object

Definition at line 3522 of file move_arm_utils.cpp.

creates a 6DOF control over the end effector of either the start or goal position of the given request.

Parameters:
datathe motion plan request to create a 6DOF control over
typeeither the start or goal position of the request
rePose,ifthe interactive marker already exists, should it be re-posed?

Definition at line 3092 of file move_arm_utils.cpp.

creates both the start and goal 6DOF controls for the given request, but only if those are visible and editable.

Parameters:
datathe motion plan request to create 6DOF controls for.
rePose,ifthe interactive markers already exist, should they be re-posed?

Definition at line 3077 of file move_arm_utils.cpp.

creates 1DOF controls for each of the joints of the given request and its start and end positions.

Parameters:
datathe motion plan request to create joint controls for
positioneither the start or goal position of the request.

Definition at line 3860 of file move_arm_utils.cpp.

std::string PlanningSceneEditor::createMeshObject ( const std::string &  name,
geometry_msgs::Pose  pose,
const std::string &  filename,
const tf::Vector3 &  scale,
std_msgs::ColorRGBA  color 
)

Definition at line 3482 of file move_arm_utils.cpp.

void PlanningSceneEditor::createMotionPlanRequest ( const planning_models::KinematicState start_state,
const planning_models::KinematicState end_state,
const std::string &  group_name,
const std::string &  end_effector_name,
const unsigned int &  planning_scene_name,
const bool  fromRobotState,
unsigned int &  motionPlan_id_Out 
)

Creates an entirely new motion plan request with the given parameters.

Parameters:
start_statethe kinematic state that the robot begins in.
end_statethe kinematic state to plan to.
group_namethe group that all plans will be performed for (joints outside the group are ignored)
end_effector_namethe link that IK will be solved for.
constrainshould the request constrain the pitch and roll of the end effector?
planning_scene_namethe id of the planning scene that this request occurs in.
motionPlan_id_Outthe id of the new motion plan request.
fromRobotStateshould the request start from the robot's current state, ignoring start_state?

Definition at line 1677 of file move_arm_utils.cpp.

creates an entirely new, empty planning scene.

Returns:
the newly generated id of the planning scene.

Definition at line 2049 of file move_arm_utils.cpp.

void PlanningSceneEditor::createSelectableMarkerFromCollisionObject ( arm_navigation_msgs::CollisionObject object,
std::string  name,
std::string  description,
std_msgs::ColorRGBA  color,
bool  insert_selectable = true 
) [protected]

Registers a collision object as a selectable marker.

Definition at line 2709 of file move_arm_utils.cpp.

void PlanningSceneEditor::deleteCollisionObject ( std::string &  name)

Removes the collision object with the specified name from the world.

Parameters:
namethe unique id of the object.

Definition at line 3245 of file move_arm_utils.cpp.

erases all the interactive 1DOF markers on the joints of the given request.

Parameters:
datathe motion plan request to erase.
typeerase either the start or goal joint controls.

Definition at line 3833 of file move_arm_utils.cpp.

All kinematic states in the editor are kept track of, and must be deleted with this function before the planning scene can be sent to the environment server. Otherwise, the editor will hang.

Definition at line 2245 of file move_arm_utils.cpp.

void PlanningSceneEditor::deleteMotionPlanRequest ( const unsigned int &  id,
std::vector< unsigned int > &  erased_trajectories 
)

erases the given motion plan request and all its associated trajectories.

Parameters:
idthe id of the motion plan request to delete

Definition at line 4421 of file move_arm_utils.cpp.

void PlanningSceneEditor::deleteTrajectory ( unsigned int  mpr_id,
unsigned int  traj_id 
)

erases the given trajectory from the trajectory map.

Parameters:
idthe id of the trajectory to delete.

Definition at line 4369 of file move_arm_utils.cpp.

void PlanningSceneEditor::executeTrajectory ( const std::string &  mpr_name,
const std::string &  traj_name 
)

Creates orientation constraints from a given robot state.

Parameters:
statethe state to find orientation constraints for
end_effector_linkthe link whose pose should be constrained
goal_constraintconstraint filled by the function which maintains the pitch and roll of end effector.
path_constraintconstraint filled by the function which maintains the pitch and roll of end effector. if real robot data is being used, this can be used to send a trajectory to the robot for execution.
trajectory_idthe id of the trajectory to execute.

Definition at line 4475 of file move_arm_utils.cpp.

if real robot data is being used, this can be used to send a trajectory to the robot for execution.

Parameters:
datathe trajectory to execute.

Definition at line 4049 of file move_arm_utils.cpp.

Virtual function called when the filter is invoked.

Parameters:
errorCode,theresult of the filter call.

Implemented in WarehouseViewer, and PlanningSceneEditorTest.

bool PlanningSceneEditor::filterTrajectory ( MotionPlanRequestData requestData,
TrajectoryData trajectory,
unsigned int &  filter_id 
)

Calls the trajectory filter service on the given trajectory.

Parameters:
requestDatathe request associated with the trajectory.
trajectorythe trajectory to filter.
filter_idthe id of the filtered trajectory to be returned.
Returns:
true on filtering success, or false on failure.

Definition at line 1908 of file move_arm_utils.cpp.

generates a unique collision object id.

Returns:
the newly generated id.

Definition at line 2075 of file move_arm_utils.h.

generates a unique planning scene id.

Returns:
the newly generated id.

Definition at line 2088 of file move_arm_utils.h.

bool PlanningSceneEditor::getAllAssociatedMotionPlanRequests ( const unsigned int  id,
std::vector< unsigned int > &  ids,
std::vector< std::string > &  stages,
std::vector< arm_navigation_msgs::MotionPlanRequest > &  requests 
)

loads motion plan requests associated with the given timestamp from the warehouse.

Parameters:
timethe time stamp associated with the planning scene.
idsvector of strings to be filled with the ids of motion plan requests associated with that time.
stagesvector of strings to be filled with the planning stages associated with each motion plan request.
requestsvector of MotionPlanRequests to be filled with the requests associated with the given time.
Returns:
true if query to warehouse was successful, false otherwise.

Definition at line 2236 of file move_arm_utils.cpp.

bool PlanningSceneEditor::getAllAssociatedPausedStates ( const unsigned int  id,
std::vector< ros::Time > &  paused_times 
)

loads all paused states from the warehouse associated with the given time stamp.

Parameters:
timethe time stamp of the planning scene
paused_timesvector of time stamps corresponding to each paused time.
Returns:
true if the query to warehouse was successful, false otherwise.

Definition at line 2611 of file move_arm_utils.cpp.

bool PlanningSceneEditor::getAllAssociatedTrajectorySources ( const unsigned int  planning_id,
const unsigned int  mpr_id,
std::vector< unsigned int > &  trajectory_ids,
std::vector< std::string > &  trajectory_sources 
)

loads all trajectory sources from the warehouse associated with the given time stamp.

Parameters:
timethe time stamp of the planning scene
trajectory_sourcesa vector of strings to be filled with the trajectory sources (planner, filter, etc.)
Returns:
true if the query to the warehouse was successful, false otherwise.

Definition at line 2597 of file move_arm_utils.cpp.

bool PlanningSceneEditor::getAllPlanningSceneTimes ( std::vector< ros::Time > &  planning_scene_times,
std::vector< unsigned int > &  planning_scene_ids 
)

loads all planning scene times from the warehouse.

Parameters:
planning_scene_timesa vector of time stamps corresponding to each planning scene
Returns:
true if the query to the warehouse was successful, false otherwise.

Definition at line 2207 of file move_arm_utils.cpp.

void PlanningSceneEditor::getAllRobotStampedTransforms ( const planning_models::KinematicState state,
std::vector< geometry_msgs::TransformStamped > &  trans_vector,
const ros::Time stamp 
)

gets TF data for the given kinematic state.

Parameters:
statethe kinematic state to produce transforms for
trans_vectorthe vector of TF transforms to be filled by the function.
stampthe time stamp to apply to each transform.

Definition at line 4300 of file move_arm_utils.cpp.

Definition at line 2111 of file move_arm_utils.h.

Definition at line 2142 of file move_arm_utils.h.

void PlanningSceneEditor::getMotionPlanningMarkers ( visualization_msgs::MarkerArray &  arr)

Fills the given array with mesh markers associated with all motion plan requests.

Parameters:
arrthe marker array to fill with mesh markers.

Get markers for the start

Get markers for the end.

Get collision markers for the start and end state.

TODO: Figure out why motion plans are occasionally NULL

Definition at line 1483 of file move_arm_utils.cpp.

bool planning_scene_utils::PlanningSceneEditor::getMotionPlanRequest ( const ros::Time time,
const std::string &  stage,
arm_navigation_msgs::MotionPlanRequest mpr,
std::string &  id,
std::string &  planning_scene_id 
)

loads a specific motion plan request from the warehouse.

Parameters:
timethe time stamp of the planning scene to load from.
stagethe planning stage associated with the request
mprthe MotionPlanRequest message to fill with data from the warehouse.
idthe id of the request to be generated.
planning_scene_idthe planning scene id associated with the given time.
Returns:
true if the query to the warehouse was successful, false otherwise
bool PlanningSceneEditor::getPausedState ( const unsigned int  id,
const ros::Time paused_time,
head_monitor_msgs::HeadMonitorFeedback paused_state 
)

loads a specific paused state from the warehouse

Parameters:
timethe time stamp associated with the planning scene
paused_timetime when the paused state occurred.
paused_statemessage to be filled by the warehouse.
Returns:
true if the query to teh warehouse was successful, false otherwise

Definition at line 2621 of file move_arm_utils.cpp.

bool PlanningSceneEditor::getPlanningSceneOutcomes ( const unsigned int  id,
std::vector< std::string > &  pipeline_stages,
std::vector< arm_navigation_msgs::ArmNavigationErrorCodes > &  error_codes,
std::map< std::string, arm_navigation_msgs::ArmNavigationErrorCodes > &  error_map 
)

loads all the error codes associated with a particular planning scene from the warehouse.

Parameters:
timethe time stamp of the planning scene
pipeline_stagesstd:: of strings to be filled with all request stages (planner, filter, etc.)
error_codesvector of arm navigation error codes to be filled by the warehouse.
error_mapassociates each error code with a trajectory id. To be filled by the warehouse.
Returns:
true if the query to the warehouse was successful, false otherwise.

Definition at line 2029 of file move_arm_utils.cpp.

Definition at line 2126 of file move_arm_utils.h.

void PlanningSceneEditor::getTrajectoryMarkers ( visualization_msgs::MarkerArray &  arr)

Fills the given array with mesh markers associated with all trajectories.

Parameters:
arrthe marker array to fill with mesh markers.

Get collision markers associated with trajectory.

Definition at line 1342 of file move_arm_utils.cpp.

bool PlanningSceneEditor::hasTrajectory ( const std::string &  mpr_name,
const std::string &  traj_name 
) const

Definition at line 4482 of file move_arm_utils.cpp.

void PlanningSceneEditor::IKControllerCallback ( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &  feedback)

Called when a 6DOF interactive marker is altered in RVIZ.

Parameters:
feedbackthe change that occurred to the marker.

Definition at line 2851 of file move_arm_utils.cpp.

void PlanningSceneEditor::initMotionPlanRequestData ( const unsigned int &  planning_scene_id,
const std::vector< unsigned int > &  ids,
const std::vector< std::string > &  stages,
const std::vector< arm_navigation_msgs::MotionPlanRequest > &  requests 
)

fills the motion_plan_map with new motion plan requests initialized with warehouse data.

Parameters:
planning_scene_idthe id of the planning scene these requests occur in.
idsa vector containing all the motion plan request ids
stagesa vector containing all the motion plan request stages.
requestsa vector containing all the motion plan request messages from the warehouse.

Definition at line 2478 of file move_arm_utils.cpp.

void PlanningSceneEditor::JointControllerCallback ( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &  feedback)

Called when a 1DOF joint marker is altered in RVIZ.

Parameters:
feedbackthe change that occured to the marker.

Definition at line 2824 of file move_arm_utils.cpp.

Called when the robot monitor detects a change in the robot state.

Parameters:
joint_statethe new state of the robot.

Definition at line 996 of file move_arm_utils.cpp.

Called when the arm controller has a state update.

Parameters:
jointcontrol state of the arm controller.

Definition at line 1061 of file move_arm_utils.cpp.

gets all the motion plan requests, trajectories, and planning scenes from the warehouse.

Definition at line 2099 of file move_arm_utils.cpp.

bool PlanningSceneEditor::loadPlanningScene ( const ros::Time time,
const unsigned int  id 
)

loads a particular planning scene from the warehouse

Parameters:
timethe time stamp associated with the planning scene
idthe id of the planning scene to be filled by the function.
Returns:
true if the query to the warehouse was successful, false otherwise.

Definition at line 2217 of file move_arm_utils.cpp.

Definition at line 2101 of file move_arm_utils.h.

void PlanningSceneEditor::makeInteractive1DOFRotationMarker ( tf::Transform  transform,
tf::Vector3  axis,
std::string  name,
std::string  description,
float  scale = 1.0f,
float  angle = 0.0f 
)

creates an interactive marker for rotation joint control.

Parameters:
transformthe position and orientation of the marker.
axisthe axis of rotation
namethe id of the marker
desciptionthe text to be displayed above the marker
scalethe size of the marker's radius, in meters.
anglethe initial angle of the marker about its axis.

Definition at line 3991 of file move_arm_utils.cpp.

void PlanningSceneEditor::makeInteractive1DOFTranslationMarker ( tf::Transform  transform,
tf::Vector3  axis,
std::string  name,
std::string  description,
float  scale = 1.0f,
float  value = 0.0f 
)

creates an interactive marker for prismatic joint control.

Parameters:
transformthe position and orientation of the marker.
axisthe axis of translation of the prismatic joint.
namethe id of the marker.
descriptionthe text to display above the marker.
scalethe size of the marker in meters.
valuethe initial translation of the prismatic joint along its axis.

Definition at line 3954 of file move_arm_utils.cpp.

Definition at line 1138 of file move_arm_utils.cpp.

virtual void planning_scene_utils::PlanningSceneEditor::onPlanningSceneLoaded ( int  scene,
int  numScenes 
) [inline, virtual]

pure virtual function that acts as a callback when a given scene was loaded. (Use case: things like loading bars)

Parameters:
scenethe index of the scene that was loaded
numScenesthe total number of scenes in the warehouse

Reimplemented in WarehouseViewer.

Definition at line 1773 of file move_arm_utils.h.

Virtual function called when the planner is invoked.

Parameters:
errorCode,theresult of the plan.

Implemented in WarehouseViewer, and PlanningSceneEditorTest.

bool PlanningSceneEditor::planToKinematicState ( const planning_models::KinematicState state,
const std::string &  group_name,
const std::string &  end_effector_name,
unsigned int &  trajectoryid_Out,
unsigned int &  planning_scene_id 
)

invokes the planner service to plan from the current robot state to the given kinematic state.

Parameters:
statethe state to plan to.
group_namethe group to invoke the request for.
end_effector_namethe link that IK was performed on.
constrainshould the planner constrain pitch and roll of the end effector?
trajectoryid_Outthe new planned trajectory id to be filled by the function.
planning_scene_namethe id of the planning scene that this plan occurs in.
Returns:
true if the planner was successful, and false otherwise

Definition at line 1754 of file move_arm_utils.cpp.

bool PlanningSceneEditor::planToRequest ( MotionPlanRequestData data,
unsigned int &  trajectoryid_Out 
)

invokes the planner to plan from the start position of the request to the goal position.

Parameters:
datathe motion plan request to plan for.
trajectoryid_Outthe new planned trajectory id to be filled by the function.
Returns:
true if the planner was successful, false otherwise.

Definition at line 1769 of file move_arm_utils.cpp.

bool PlanningSceneEditor::planToRequest ( const std::string &  requestid,
unsigned int &  trajectoryid_Out 
)

invokes the planner to plan from the start position of the request to the goal position.

Parameters:
requestidthe motion plan request to plan for.
trajectoryid_Outthe new planned trajectory id to be filled by the function.
Returns:
true if the planner was successful, false otherwise.

Definition at line 1764 of file move_arm_utils.cpp.

non-blocking call resetting the given trajectory and setting it to play and be visible.

Parameters:
requestDatathe motion plan request associated with the trajectory
datathe trajectory to play.
Returns:
true if the trajectory can be played, false otherwise.

Definition at line 2632 of file move_arm_utils.cpp.

void PlanningSceneEditor::printTrajectoryPoint ( const std::vector< std::string > &  joint_names,
const std::vector< double > &  joint_values 
)

for debugging, prints the given trajectory point values.

Definition at line 1900 of file move_arm_utils.cpp.

sets the motion plan request start or goal to a set of random joint values. Avoids collisions

Parameters:
mprthe motion plan request to randomize.
typeeither the start or goal of the motion plan request.

Definition at line 4158 of file move_arm_utils.cpp.

creates an interactive marker menu with the given name, associating it with a callback function.

Parameters:
menuthe menu handler to register the entry in.
entryNamethe name of the menu entry.
callbackthe function to call when this menu entry is pressed
Returns:
the menu handle of the registered entry.

Definition at line 4361 of file move_arm_utils.cpp.

MenuHandler::EntryHandle PlanningSceneEditor::registerSubMenuEntry ( std::string  menu,
std::string  name,
std::string  subMenu,
interactive_markers::MenuHandler::FeedbackCallback callback 
)

registers a new menu entry as a sub menu of an exitsting interactive marker menu entry

Parameters:
menuthe menu handler maintaining the menu.
namethe name of the entry to make a sub menu for.
subMenuthe name of the sub menu entry
callbackthe function to call when this menu is clicked.
Returns:
the menu handle for the registered entry.

Definition at line 4352 of file move_arm_utils.cpp.

void PlanningSceneEditor::savePlanningScene ( PlanningSceneData data,
bool  copy = false 
)

Pushes the given planning scene to the warehouse with ros::WallTime::now() as its timestamp.

Parameters:
datathe planning scene to push to the warehouse.

Definition at line 2131 of file move_arm_utils.cpp.

virtual void planning_scene_utils::PlanningSceneEditor::selectedTrajectoryCurrentPointChanged ( unsigned int  new_current_point) [inline, protected, virtual]

Called when the selected trajectory of the selected motion plan updates its current point. Override to do something useful.

Parameters:
new_current_pointthe new current point in the selected trajectory.

Reimplemented in WarehouseViewer.

Definition at line 1446 of file move_arm_utils.h.

sends all stored mesh and sphere markers for collisions and links to rviz.

Definition at line 2012 of file move_arm_utils.cpp.

sends a planning scene diff message to the environment server, updating the global planning scene.

Parameters:
datathe planning scene to send.
Returns:
true if sending the diff was successful, and false otherwise.

Definition at line 2291 of file move_arm_utils.cpp.

sends all TF transforms and a wall clock time to ROS.

Definition at line 4331 of file move_arm_utils.cpp.

Definition at line 2116 of file move_arm_utils.h.

void PlanningSceneEditor::setCurrentPlanningScene ( std::string  id,
bool  loadRequests = true,
bool  loadTrajectories = true 
)

loads the given planning scene from the warehouse.

Parameters:
idthe id of the planning scene to load.
loadRequestsshould the motion plan requests be loaded as well?
loadTrajectoriesshould the trajectories be loaded as well?

Get rid of old interactive markers.

Make sure all old trajectories and MPRs are gone.

Load planning scene

Create collision object.

Create collision object.

Load motion plan requests

Load trajectories

Definition at line 1170 of file move_arm_utils.cpp.

void PlanningSceneEditor::setIKControlsVisible ( std::string  id,
PositionType  type,
bool  visible 
)

either shows or hides the 6DOF interactive markers associated with the given request.

Parameters:
idthe id of the motion plan request.
typeeither the start or goal position of the request.
visibleshould the 6DOF controller be shown or not?

Definition at line 4028 of file move_arm_utils.cpp.

void PlanningSceneEditor::setJointState ( MotionPlanRequestData data,
PositionType  position,
std::string &  jointName,
tf::Transform  value 
)

attempts to set the state of the given joint in the given motion plan request so that it matches the given transform.

Parameters:
datathe motion plan request to set joint states for.
positioneither the start or goal position of the motion plan request.
jointNamethe joint to set the state for.
valuethe joint will attempt to match this position and orientation.

Definition at line 3751 of file move_arm_utils.cpp.

Definition at line 2147 of file move_arm_utils.h.

void planning_scene_utils::PlanningSceneEditor::setRobotState ( planning_models::KinematicState robot_state,
bool  shouldDelete = true 
) [inline]

Definition at line 2131 of file move_arm_utils.h.

bool PlanningSceneEditor::solveIKForEndEffectorPose ( MotionPlanRequestData mpr,
planning_scene_utils::PositionType  type,
bool  coll_aware = true,
double  change_redundancy = 0.0 
)

invokes the inverse kinematics solver on the given motion plan requests' start or end state, setting the joint values of that state to the solution.

Parameters:
mprthe motion plan request to solve IK for.
typesolve for either the start position or the goal position.
coll_awareshould the IK solution be constrained as collision-free?
constrain_pitch_and_rollshould the IK solution maintain the pitch and roll of the end effector?
change_redundancyalters the redundant joint of the robot by the given amount.
Returns:
true if an IK solution was found, false otherwise.

Definition at line 3614 of file move_arm_utils.cpp.

Definition at line 2106 of file move_arm_utils.h.

if robot data is not being used, publishes fake joint states of the current robot state to a robot state publisher node.

Definition at line 1972 of file move_arm_utils.cpp.

virtual void planning_scene_utils::PlanningSceneEditor::updateState ( ) [inline, protected, virtual]

Pure virtual function called when a trajectory, motion plan request, or the robot's state is changed.

Reimplemented in WarehouseViewer.

Definition at line 1420 of file move_arm_utils.h.


Member Data Documentation

Definition at line 1495 of file move_arm_utils.h.

Definition at line 1490 of file move_arm_utils.h.

Definition at line 1510 of file move_arm_utils.h.

Definition at line 1455 of file move_arm_utils.h.

Definition at line 1451 of file move_arm_utils.h.

Definition at line 1529 of file move_arm_utils.h.

Definition at line 1504 of file move_arm_utils.h.

visualization_msgs::MarkerArray planning_scene_utils::PlanningSceneEditor::collision_markers_ [protected]

Definition at line 1505 of file move_arm_utils.h.

Definition at line 1512 of file move_arm_utils.h.

Definition at line 1511 of file move_arm_utils.h.

Definition at line 1462 of file move_arm_utils.h.

Definition at line 1521 of file move_arm_utils.h.

Definition at line 1463 of file move_arm_utils.h.

Definition at line 1464 of file move_arm_utils.h.

Definition at line 1532 of file move_arm_utils.h.

Definition at line 1476 of file move_arm_utils.h.

Definition at line 1484 of file move_arm_utils.h.

Definition at line 1513 of file move_arm_utils.h.

Definition at line 1519 of file move_arm_utils.h.

Definition at line 1516 of file move_arm_utils.h.

Definition at line 1531 of file move_arm_utils.h.

Map of joint controls and whether they have been clicked by the user.

Definition at line 1571 of file move_arm_utils.h.

Definition at line 1514 of file move_arm_utils.h.

Map of joint controls and their last transforms.

Definition at line 1574 of file move_arm_utils.h.

Definition at line 1456 of file move_arm_utils.h.

Definition at line 1459 of file move_arm_utils.h.

Definition at line 1461 of file move_arm_utils.h.

Definition at line 1537 of file move_arm_utils.h.

Definition at line 1449 of file move_arm_utils.h.

Definition at line 1487 of file move_arm_utils.h.

Definition at line 1544 of file move_arm_utils.h.

Definition at line 1538 of file move_arm_utils.h.

Definition at line 1535 of file move_arm_utils.h.

Definition at line 1466 of file move_arm_utils.h.

Definition at line 1467 of file move_arm_utils.h.

Definition at line 1477 of file move_arm_utils.h.

Definition at line 1478 of file move_arm_utils.h.

boost::recursive_mutex planning_scene_utils::PlanningSceneEditor::lock_scene_ [protected]

Definition at line 1448 of file move_arm_utils.h.

Definition at line 1524 of file move_arm_utils.h.

Definition at line 1525 of file move_arm_utils.h.

trajectory_msgs::JointTrajectory planning_scene_utils::PlanningSceneEditor::logged_trajectory_ [protected]

Definition at line 1498 of file move_arm_utils.h.

Definition at line 1499 of file move_arm_utils.h.

Definition at line 1501 of file move_arm_utils.h.

Definition at line 1500 of file move_arm_utils.h.

Definition at line 1545 of file move_arm_utils.h.

Definition at line 1492 of file move_arm_utils.h.

Definition at line 1491 of file move_arm_utils.h.

Definition at line 1526 of file move_arm_utils.h.

Definition at line 1527 of file move_arm_utils.h.

Definition at line 1540 of file move_arm_utils.h.

Map containing all motion plan requests, indexed by (unique) name.

Definition at line 1568 of file move_arm_utils.h.

Definition at line 1450 of file move_arm_utils.h.

Definition at line 1454 of file move_arm_utils.h.

Definition at line 1468 of file move_arm_utils.h.

Definition at line 1469 of file move_arm_utils.h.

Definition at line 1530 of file move_arm_utils.h.

Definition at line 1453 of file move_arm_utils.h.

Definition at line 1481 of file move_arm_utils.h.

Definition at line 1506 of file move_arm_utils.h.

Definition at line 1470 of file move_arm_utils.h.

Definition at line 1471 of file move_arm_utils.h.

Map containing all planning scenes, indexed by (unique) name.

Definition at line 1562 of file move_arm_utils.h.

Definition at line 1507 of file move_arm_utils.h.

Definition at line 1460 of file move_arm_utils.h.

Definition at line 1472 of file move_arm_utils.h.

Definition at line 1473 of file move_arm_utils.h.

Definition at line 1452 of file move_arm_utils.h.

Definition at line 1486 of file move_arm_utils.h.

std::vector<geometry_msgs::TransformStamped> planning_scene_utils::PlanningSceneEditor::robot_transforms_ [protected]

Definition at line 1508 of file move_arm_utils.h.

Definition at line 1518 of file move_arm_utils.h.

Definition at line 1522 of file move_arm_utils.h.

Definition at line 1523 of file move_arm_utils.h.

Definition at line 1503 of file move_arm_utils.h.

Definition at line 1483 of file move_arm_utils.h.

Definition at line 1465 of file move_arm_utils.h.

Definition at line 1533 of file move_arm_utils.h.

Definition at line 1480 of file move_arm_utils.h.

Definition at line 1541 of file move_arm_utils.h.

Definition at line 1542 of file move_arm_utils.h.

Definition at line 1474 of file move_arm_utils.h.

Definition at line 1475 of file move_arm_utils.h.

std::map<std::string, std::map<std::string, TrajectoryData> > planning_scene_utils::PlanningSceneEditor::trajectory_map_

Map containing all trajectories, indexed by (unique) motion plan id name, and then by unique trajectory name.

Definition at line 1565 of file move_arm_utils.h.

Definition at line 1488 of file move_arm_utils.h.

Definition at line 1489 of file move_arm_utils.h.

Definition at line 1479 of file move_arm_utils.h.

Definition at line 1482 of file move_arm_utils.h.

Definition at line 1496 of file move_arm_utils.h.

Definition at line 1457 of file move_arm_utils.h.

Definition at line 1458 of file move_arm_utils.h.

Definition at line 1494 of file move_arm_utils.h.


The documentation for this class was generated from the following files:


move_arm_warehouse
Author(s): Ioan Sucan, Sachin Chitta(sachinc@willowgarage.com)
autogenerated on Thu Dec 12 2013 11:09:12