37 #ifndef MOVEIT_MOTION_PLANNING_RVIZ_PLUGIN_MOTION_PLANNING_FRAME_ 38 #define MOVEIT_MOTION_PLANNING_RVIZ_PLUGIN_MOTION_PLANNING_FRAME_ 41 #include <QTreeWidgetItem> 42 #include <QListWidgetItem> 54 #include <moveit_msgs/MotionPlanRequest.h> 56 #include <object_recognition_msgs/ObjectRecognitionAction.h> 58 #include <std_msgs/Bool.h> 59 #include <std_msgs/Empty.h> 73 class MotionPlanningUI;
85 class MotionPlanningDisplay;
106 void changePlanningGroup();
112 static const int ITEM_TYPE_SCENE = 1;
113 static const int ITEM_TYPE_QUERY = 2;
115 void constructPlanningRequest(moveit_msgs::MotionPlanRequest& mreq);
117 void updateSceneMarkers(
float wall_dt,
float ros_dt);
119 void updateExternalCommunication();
123 Ui::MotionPlanningUI*
ui_;
141 void planningFinished();
146 void databaseConnectButtonClicked();
147 void publishSceneButtonClicked();
148 void planningAlgorithmIndexChanged(
int index);
149 void resetDbButtonClicked();
150 void approximateIKChanged(
int state);
153 void planButtonClicked();
154 void executeButtonClicked();
155 void planAndExecuteButtonClicked();
156 void stopButtonClicked();
157 void allowReplanningToggled(
bool checked);
158 void allowLookingToggled(
bool checked);
159 void allowExternalProgramCommunication(
bool enable);
160 void pathConstraintsIndexChanged(
int index);
161 void useStartStateButtonClicked();
162 void useGoalStateButtonClicked();
163 void onClearOctomapClicked();
166 void importFileButtonClicked();
167 void importUrlButtonClicked();
168 void clearSceneButtonClicked();
169 void sceneScaleChanged(
int value);
170 void sceneScaleStartChange();
171 void sceneScaleEndChange();
172 void removeObjectButtonClicked();
173 void selectedCollisionObjectChanged();
174 void objectPoseValueChanged(
double value);
175 void collisionObjectChanged(QListWidgetItem* item);
176 void imProcessFeedback(visualization_msgs::InteractiveMarkerFeedback& feedback);
177 void copySelectedCollisionObject();
178 void exportAsTextButtonClicked();
179 void importFromTextButtonClicked();
182 void saveSceneButtonClicked();
183 void planningSceneItemClicked();
184 void saveQueryButtonClicked();
185 void deleteSceneButtonClicked();
186 void deleteQueryButtonClicked();
187 void loadSceneButtonClicked();
188 void loadQueryButtonClicked();
189 void warehouseItemNameChanged(QTreeWidgetItem* item,
int column);
192 void loadStateButtonClicked();
193 void saveStartStateButtonClicked();
194 void saveGoalStateButtonClicked();
195 void removeStateButtonClicked();
196 void clearStatesButtonClicked();
197 void setAsStartStateButtonClicked();
198 void setAsGoalStateButtonClicked();
201 void detectObjectsButtonClicked();
202 void pickObjectButtonClicked();
203 void placeObjectButtonClicked();
204 void selectedDetectedObjectChanged();
205 void detectedObjectChanged(QListWidgetItem* item);
206 void selectedSupportSurfaceChanged();
209 void tabChanged(
int index);
213 void computeDatabaseConnectButtonClicked();
214 void computeDatabaseConnectButtonClickedHelper(
int mode);
215 void computeResetDbButtonClicked(
const std::string& db);
216 void populatePlannersList(
const moveit_msgs::PlannerInterfaceDescription& desc);
219 void computePlanButtonClicked();
220 void computeExecuteButtonClicked();
221 void computePlanAndExecuteButtonClicked();
222 void computePlanAndExecuteButtonClickedDisplayHelper();
223 void computeStopButtonClicked();
224 void onFinishedExecution(
bool success);
225 void populateConstraintsList();
226 void populateConstraintsList(
const std::vector<std::string>& constr);
227 void configureForPlanning();
228 void configureWorkspace();
229 void updateQueryStateHelper(robot_state::RobotState& state,
const std::string& v);
230 void fillStateSelectionOptions();
231 void useStartStateButtonExec();
232 void useGoalStateButtonExec();
235 void addObject(
const collision_detection::WorldPtr& world,
const std::string&
id,
const shapes::ShapeConstPtr& shape,
236 const Eigen::Affine3d& pose);
237 void updateCollisionObjectPose(
bool update_marker_position);
238 void createSceneInteractiveMarker();
239 void renameCollisionObject(QListWidgetItem* item);
240 void attachDetachCollisionObject(QListWidgetItem* item);
241 void populateCollisionObjectsList();
242 void computeImportFromText(
const std::string& path);
243 void computeExportAsText(
const std::string& path);
246 void computeSaveSceneButtonClicked();
247 void computeSaveQueryButtonClicked(
const std::string& scene,
const std::string& query_name);
248 void computeLoadSceneButtonClicked();
249 void computeLoadQueryButtonClicked();
250 void populatePlanningSceneTreeView();
251 void computeDeleteSceneButtonClicked();
252 void computeDeleteQueryButtonClicked();
253 void computeDeleteQueryButtonClickedHelper(QTreeWidgetItem* s);
254 void checkPlanningSceneTreeEnabledButtons();
257 void saveRobotStateButtonClicked(
const robot_state::RobotState& state);
258 void populateRobotStatesList();
261 void processDetectedObjects();
262 void updateDetectedObjectsList(
const std::vector<std::string>& object_ids,
const std::vector<std::string>& objects);
263 void publishTables();
264 void updateSupportSurfacesList();
271 void triggerObjectDetection();
278 std::unique_ptr<actionlib::SimpleActionClient<object_recognition_msgs::ObjectRecognitionAction> >
280 template <
typename T>
282 const std::string& name);
283 void listenDetectedObjects(
const object_recognition_msgs::RecognizedObjectArrayPtr& msg);
294 void changePlanningGroupHelper();
295 void importResource(
const std::string& path);
296 void loadStoredStates(
const std::string& pattern);
298 void remotePlanCallback(
const std_msgs::EmptyConstPtr& msg);
299 void remoteExecuteCallback(
const std_msgs::EmptyConstPtr& msg);
300 void remoteStopCallback(
const std_msgs::EmptyConstPtr& msg);
301 void remoteUpdateStartStateCallback(
const std_msgs::EmptyConstPtr& msg);
302 void remoteUpdateGoalStateCallback(
const std_msgs::EmptyConstPtr& msg);
303 void remoteUpdateCustomStartStateCallback(
const moveit_msgs::RobotStateConstPtr& msg);
304 void remoteUpdateCustomGoalStateCallback(
const moveit_msgs::RobotStateConstPtr& msg);
307 void setItemSelectionInList(
const std::string& item_name,
bool selection, QListWidget* list);
322 template <
typename T>
323 void MotionPlanningFrame::waitForAction(
const T& action,
const ros::NodeHandle& node_handle,
324 const ros::Duration& wait_for_server,
const std::string& name)
326 ROS_DEBUG(
"Waiting for MoveGroup action server (%s)...", name.c_str());
340 while (node_handle.
ok() && !action->isServerConnected())
357 if (!action->isServerConnected())
358 throw std::runtime_error(
"Unable to connect to move_group action server within allotted time");
360 ROS_DEBUG(
"Connected to '%s'", name.c_str());
ros::Subscriber update_goal_state_subscriber_
long unsigned int known_collision_objects_version_
MOVEIT_CLASS_FORWARD(RobotStateVisualization)
std::string selected_object_name_
moveit::planning_interface::MoveGroupInterface::PlanPtr current_plan_
std::map< std::string, moveit_msgs::RobotState > RobotStateMap
ros::Subscriber update_custom_goal_state_subscriber_
ros::Subscriber plan_subscriber_
std::string place_object_name_
static const std::string TAB_OBJECTS
static const std::string TAB_CONTEXT
ros::Subscriber execute_subscriber_
ros::ServiceClient clear_octomap_service_client_
static const std::string TAB_STATES
ros::Subscriber object_recognition_subscriber_
ros::Publisher object_recognition_trigger_publisher_
ros::Subscriber update_start_state_subscriber_
World::ObjectConstPtr ObjectConstPtr
moveit::planning_interface::MoveGroupInterfacePtr move_group_
std::string selected_support_surface_name_
ros::Subscriber update_custom_start_state_subscriber_
moveit_warehouse::RobotStateStoragePtr robot_state_storage_
ros::Subscriber stop_subscriber_
moveit_warehouse::ConstraintsStoragePtr constraints_storage_
static const std::string TAB_SCENES
MotionPlanningDisplay * planning_display_
Ui::MotionPlanningUI * ui_
const std::string OBJECT_RECOGNITION_ACTION
std::string support_surface_name_
std::vector< std::pair< std::string, bool > > known_collision_objects_
std::shared_ptr< rviz::InteractiveMarker > scene_marker_
std::pair< std::string, moveit_msgs::RobotState > RobotStatePair
RobotStateMap robot_states_
std::vector< geometry_msgs::PoseStamped > place_poses_
std::map< std::string, std::string > pick_object_name_
static const std::string TAB_MANIPULATION
ros::Publisher planning_scene_world_publisher_
rviz::DisplayContext * context_
static const std::string TAB_PLANNING
ROSCPP_DECL void spinOnce()
collision_detection::CollisionWorld::ObjectConstPtr scaled_object_
static const std::string TAB_STATUS
moveit_warehouse::PlanningSceneStoragePtr planning_scene_storage_
std::unique_ptr< actionlib::SimpleActionClient< object_recognition_msgs::ObjectRecognitionAction > > object_recognition_client_
ros::Publisher planning_scene_publisher_
moveit::planning_interface::PlanningSceneInterfacePtr planning_scene_interface_
moveit::semantic_world::SemanticWorldPtr semantic_world_
std::shared_ptr< const Shape > ShapeConstPtr