43 #include <rviz_default_plugins/robot/robot.hpp>
44 #include <rviz_default_plugins/robot/robot_link.hpp>
47 #include <rviz_common/properties/property.hpp>
48 #include <rviz_common/properties/string_property.hpp>
49 #include <rviz_common/properties/bool_property.hpp>
50 #include <rviz_common/properties/float_property.hpp>
51 #include <rviz_common/properties/ros_topic_property.hpp>
52 #include <rviz_common/properties/editable_enum_property.hpp>
53 #include <rviz_common/properties/color_property.hpp>
54 #include <rviz_common/display_context.hpp>
55 #include <rviz_common/frame_manager_iface.hpp>
56 #include <rviz_common/panel_dock_widget.hpp>
57 #include <rviz_common/window_manager_interface.hpp>
58 #include <rviz_common/display.hpp>
59 #include <rviz_rendering/objects/movable_text.hpp>
61 #include <OgreSceneManager.h>
62 #include <OgreSceneNode.h>
63 #include <rviz_rendering/objects/shape.hpp>
68 #include <boost/format.hpp>
69 #include <boost/algorithm/string/replace.hpp>
70 #include <boost/algorithm/string/trim.hpp>
74 #include "ui_motion_planning_rviz_plugin_frame.h"
79 static const rclcpp::Logger
LOGGER = rclcpp::get_logger(
"moveit_ros_visualization.motion_planning_display");
86 , text_to_display_(nullptr)
88 , frame_dock_(nullptr)
91 , int_marker_display_(nullptr)
94 plan_category_ =
new rviz_common::properties::Property(
"Planning Request", QVariant(),
"",
this);
95 metrics_category_ =
new rviz_common::properties::Property(
"Planning Metrics", QVariant(),
"",
this);
96 path_category_ =
new rviz_common::properties::Property(
"Planned Path", QVariant(),
"",
this);
100 new rviz_common::properties::BoolProperty(
"Show Weight Limit",
false,
101 "Shows the weight limit at a particular pose for an end-effector",
105 new rviz_common::properties::BoolProperty(
"Show Manipulability Index",
false,
107 SLOT(changedShowManipulabilityIndex()),
this);
110 new rviz_common::properties::BoolProperty(
"Show Manipulability",
false,
112 SLOT(changedShowManipulability()),
this);
115 new rviz_common::properties::BoolProperty(
"Show Joint Torques",
false,
116 "Shows the joint torques for a given configuration and payload",
120 new rviz_common::properties::FloatProperty(
"Payload", 1.0f,
"Specify the payload at the end effector (kg)",
125 "TextHeight", 0.08f,
"Text height",
metrics_category_, SLOT(changedMetricsTextHeight()),
this);
131 "Planning Group",
"",
"The name of the group of links to plan for (from the ones defined in the SRDF)",
134 "Shows the axis-aligned bounding box for "
135 "the workspace allowed for planning",
138 new rviz_common::properties::BoolProperty(
"Query Start State",
false,
139 "Set a custom start state for the motion planning query",
142 new rviz_common::properties::BoolProperty(
"Query Goal State",
true,
143 "Shows the goal state for the motion planning query",
plan_category_,
144 SLOT(changedQueryGoalState()),
this);
146 "Interactive Marker Size", 0.0f,
147 "Specifies scale of the interactive marker overlaid on the robot. 0 is auto scale.",
plan_category_,
148 SLOT(changedQueryMarkerScale()),
this);
152 new rviz_common::properties::ColorProperty(
"Start State Color", QColor(0, 255, 0),
154 SLOT(changedQueryStartColor()),
this);
156 new rviz_common::properties::FloatProperty(
"Start State Alpha", 1.0f,
"Specifies the alpha for the robot links",
162 new rviz_common::properties::ColorProperty(
"Goal State Color", QColor(250, 128, 0),
164 SLOT(changedQueryGoalColor()),
this);
167 new rviz_common::properties::FloatProperty(
"Goal State Alpha", 1.0f,
"Specifies the alpha for the robot links",
173 new rviz_common::properties::ColorProperty(
"Colliding Link Color", QColor(255, 0, 0),
175 SLOT(changedQueryCollidingLinkColor()),
this);
178 "Joint Violation Color", QColor(255, 0, 255),
179 "The highlight color for child links of joints that are outside bounds",
plan_category_,
180 SLOT(changedQueryJointViolationColor()),
this);
216 std::make_shared<RobotStateVisualization>(
planning_scene_node_, context_,
"Planning Request Start",
nullptr);
220 std_msgs::msg::ColorRGBA color;
222 color.r = qcolor.redF();
223 color.g = qcolor.greenF();
224 color.b = qcolor.blueF();
229 std::make_shared<RobotStateVisualization>(
planning_scene_node_, context_,
"Planning Request Goal",
nullptr);
234 color.r = qcolor.redF();
235 color.g = qcolor.greenF();
236 color.b = qcolor.blueF();
239 rviz_common::WindowManagerInterface* window_context = context_->getWindowManager();
242 connect(
frame_, SIGNAL(configChanged()), this->getModel(), SIGNAL(configChanged()));
252 connect(
frame_dock_, SIGNAL(visibilityChanged(
bool)),
this, SLOT(motionPanelVisibilityChange(
bool)));
261 text_to_display_->setTextAlignment(rviz_rendering::MovableText::H_CENTER, rviz_rendering::MovableText::V_CENTER);
268 if (context_ && context_->getWindowManager() && context_->getWindowManager()->getParentWindow())
270 QShortcut* im_reset_shortcut =
271 new QShortcut(QKeySequence(
"Ctrl+I"), context_->getWindowManager()->getParentWindow());
272 connect(im_reset_shortcut, SIGNAL(activated()),
this, SLOT(resetInteractiveMarkers()));
276 void MotionPlanningDisplay::motionPanelVisibilityChange(
bool enable)
287 "/rviz/moveit/select_planning_group", rclcpp::SystemDefaultsQoS(),
314 bool enabled = this->isEnabled();
334 QProgressBar*
p =
frame_->
ui_->background_job_progress;
345 if (
p->maximum() < n)
352 p->setValue(
p->maximum() - n);
357 void MotionPlanningDisplay::changedShowWeightLimit()
371 void MotionPlanningDisplay::changedShowManipulabilityIndex()
385 void MotionPlanningDisplay::changedShowManipulability()
399 void MotionPlanningDisplay::changedShowJointTorques()
413 void MotionPlanningDisplay::changedMetricsSetPayload()
427 void MotionPlanningDisplay::changedMetricsTextHeight()
433 const Ogre::Vector3& pos,
const Ogre::Quaternion& orient)
436 std::stringstream ss;
437 for (
const std::pair<const std::string, double>& value : values)
438 ss << boost::format(
"%-10s %-4.2f") % value.first % value.second <<
'\n';
440 if (ss.str().empty())
466 workspace_box_ = std::make_unique<rviz_rendering::Shape>(rviz_rendering::Shape::Cube, context_->getSceneManager(),
471 Ogre::Vector3 center(
frame_->
ui_->wcenter_x->value(),
frame_->
ui_->wcenter_y->value(),
482 const std::vector<robot_interaction::EndEffectorInteraction>& eef =
robot_interaction_->getActiveEndEffectors();
489 if (ee.parent_group ==
group)
498 dynamics_solver::DynamicsSolverPtr ds;
507 unsigned int saturated_joint;
508 std::vector<double> joint_values;
510 if (ds->getMaxPayload(joint_values, max_payload, saturated_joint))
512 metrics[
"max_payload"] = max_payload;
513 metrics[
"saturated_joint"] = saturated_joint;
515 std::vector<double> joint_torques;
516 joint_torques.resize(joint_values.size());
517 if (ds->getPayloadTorques(joint_values, payload, joint_torques))
519 for (std::size_t i = 0; i < joint_torques.size(); ++i)
521 std::stringstream stream;
522 stream <<
"torque[" << i <<
"]";
523 metrics[stream.str()] = joint_torques[i];
533 double manipulability_index, manipulability;
536 metrics[
"manipulability_index"] = manipulability_index;
538 metrics[
"manipulability"] = manipulability;
544 inline void copyItemIfExists(
const std::map<std::string, double>& source, std::map<std::string, double>&
dest,
545 const std::string& key)
547 std::map<std::string, double>::const_iterator it = source.find(key);
548 if (it != source.end())
549 dest[key] = it->second;
558 static const Ogre::Quaternion
ORIENTATION(1.0, 0.0, 0.0, 0.0);
559 const std::vector<robot_interaction::EndEffectorInteraction>& eef =
robot_interaction_->getActiveEndEffectors();
567 Ogre::Vector3 position(0.0, 0.0, 0.0);
568 std::map<std::string, double> text_table;
569 const std::map<std::string, double>& metrics_table =
computed_metrics_[std::make_pair(start, ee.parent_group)];
572 copyItemIfExists(metrics_table, text_table,
"max_payload");
573 copyItemIfExists(metrics_table, text_table,
"saturated_joint");
576 copyItemIfExists(metrics_table, text_table,
"manipulability_index");
578 copyItemIfExists(metrics_table, text_table,
"manipulability");
581 std::size_t nj =
getRobotModel()->getJointModelGroup(ee.parent_group)->getJointModelNames().size();
582 for (
size_t j = 0; j < nj; ++j)
584 std::stringstream stream;
585 stream <<
"torque[" << j <<
"]";
586 copyItemIfExists(metrics_table, text_table, stream.str());
597 const Eigen::Vector3d& t = state->getGlobalLinkTransform(lm).translation();
600 position[2] = t.z() + 0.2;
626 std::vector<std::string> collision_links;
629 for (
const std::string& collision_link : collision_links)
631 if (!collision_links.empty())
637 for (collision_detection::CollisionResult::ContactMap::const_iterator it = pairs.begin(); it != pairs.end();
647 std::vector<std::string> outside_bounds;
650 if (!state->satisfiesBounds(jmodel, jmodel->getMaximumExtent() * 1e-2))
652 outside_bounds.push_back(jmodel->getChildLinkModel()->getName());
655 if (!outside_bounds.empty())
658 addStatusText(
"Links descending from joints that are outside bounds in start state:");
670 context_->queueRender();
681 frame_->
ui_->status_text->setTextColor(color);
687 frame_->
ui_->status_text->append(QString::fromStdString(
text));
692 for (
const std::string& it :
text)
710 void MotionPlanningDisplay::changedQueryStartState()
720 void MotionPlanningDisplay::changedQueryGoalState()
745 std::vector<std::string> collision_links;
748 for (
const std::string& collision_link : collision_links)
750 if (!collision_links.empty())
756 for (collision_detection::CollisionResult::ContactMap::const_iterator it = pairs.begin(); it != pairs.end();
768 std::vector<std::string> outside_bounds;
770 if (!state->satisfiesBounds(jmodel, jmodel->getMaximumExtent() * 1e-2))
772 outside_bounds.push_back(jmodel->getChildLinkModel()->getName());
776 if (!outside_bounds.empty())
779 addStatusText(
"Links descending from joints that are outside bounds in goal state:");
792 context_->queueRender();
795 void MotionPlanningDisplay::resetInteractiveMarkers()
831 void MotionPlanningDisplay::changedQueryStartColor()
833 std_msgs::msg::ColorRGBA color;
835 color.r = qcolor.redF();
836 color.g = qcolor.greenF();
837 color.b = qcolor.blueF();
840 changedQueryStartState();
843 void MotionPlanningDisplay::changedQueryStartAlpha()
846 changedQueryStartState();
849 void MotionPlanningDisplay::changedQueryMarkerScale()
861 void MotionPlanningDisplay::changedQueryGoalColor()
863 std_msgs::msg::ColorRGBA color;
865 color.r = qcolor.redF();
866 color.g = qcolor.greenF();
867 color.b = qcolor.blueF();
870 changedQueryGoalState();
873 void MotionPlanningDisplay::changedQueryGoalAlpha()
876 changedQueryGoalState();
879 void MotionPlanningDisplay::changedQueryCollidingLinkColor()
881 changedQueryStartState();
882 changedQueryGoalState();
885 void MotionPlanningDisplay::changedQueryJointViolationColor()
887 changedQueryStartState();
888 changedQueryGoalState();
891 void MotionPlanningDisplay::changedAttachedBodyColor()
900 bool error_state_changed)
905 "publishInteractiveMarkers");
910 bool error_state_changed)
915 "publishInteractiveMarkers");
924 context_->queueRender();
932 context_->queueRender();
966 const double* ik_solution)
const
989 for (std::map<std::string, LinkDisplayStatus>::const_iterator it =
status_links_start_.begin();
997 for (std::map<std::string, LinkDisplayStatus>::const_iterator it =
status_links_goal_.begin();
1017 RCLCPP_ERROR(LOGGER,
"Group [%s] not found in the robot model.",
group.c_str());
1020 void MotionPlanningDisplay::changedPlanningGroup()
1044 void MotionPlanningDisplay::changedWorkspace()
1058 std::string v =
"<" + state_name +
">";
1060 if (v ==
"<random>")
1065 else if (v ==
"<current>")
1069 state = ps->getCurrentState();
1071 else if (v ==
"<same as goal>")
1075 else if (v ==
"<same as start>")
1091 typedef interactive_markers::MenuHandler immh;
1092 std::vector<std::string> state_names;
1093 state_names.push_back(
"random");
1094 state_names.push_back(
"current");
1095 state_names.push_back(
"same as start");
1096 state_names.push_back(
"same as goal");
1102 immh::EntryHandle menu_states =
1103 mh->insert(is_start ?
"Set start state to" :
"Set goal state to", immh::FeedbackCallback());
1104 for (
const std::string& state_name : state_names)
1107 if ((state_name ==
"same as start" && is_start) || (state_name ==
"same as goal" && !is_start))
1109 mh->insert(menu_states, state_name,
1148 const double* joint_group_variable_values) {
1183 const std::vector<std::string>& groups =
getRobotModel()->getJointModelGroupNames();
1185 for (
const std::string&
group : groups)
1194 geometry_msgs::msg::Vector3 gravity_vector;
1195 gravity_vector.x = 0.0;
1196 gravity_vector.y = 0.0;
1197 gravity_vector.z = 9.81;
1200 for (
const std::string&
group : groups)
1203 std::make_shared<dynamics_solver::DynamicsSolver>(
getRobotModel(),
group, gravity_vector);
1206 frame_->fillPlanningGroupOptions();
1207 changedPlanningGroup();
1211 frame_->onNewPlanningSceneState();
1223 std::vector<double> values_to_keep;
1224 dest.copyJointGroupPositions(jmg, values_to_keep);
1332 if (config.mapGetFloat(
"MoveIt_Planning_Time", &
d))
1335 if (config.mapGetInt(
"MoveIt_Planning_Attempts", &attempts))
1336 frame_->
ui_->planning_attempts->setValue(attempts);
1337 if (config.mapGetFloat(
"Velocity_Scaling_Factor", &
d))
1338 frame_->
ui_->velocity_scaling_factor->setValue(
d);
1339 if (config.mapGetFloat(
"Acceleration_Scaling_Factor", &
d))
1340 frame_->
ui_->acceleration_scaling_factor->setValue(
d);
1343 if (config.mapGetBool(
"MoveIt_Allow_Replanning", &b))
1344 frame_->
ui_->allow_replanning->setChecked(b);
1345 if (config.mapGetBool(
"MoveIt_Allow_Sensor_Positioning", &b))
1346 frame_->
ui_->allow_looking->setChecked(b);
1347 if (config.mapGetBool(
"MoveIt_Allow_External_Program", &b))
1348 frame_->
ui_->allow_external_program->setChecked(b);
1349 if (config.mapGetBool(
"MoveIt_Use_Cartesian_Path", &b))
1350 frame_->
ui_->use_cartesian_path->setChecked(b);
1351 if (config.mapGetBool(
"MoveIt_Use_Constraint_Aware_IK", &b))
1352 frame_->
ui_->collision_aware_ik->setChecked(b);
1353 if (config.mapGetBool(
"MoveIt_Allow_Approximate_IK", &b))
1354 frame_->
ui_->approximate_ik->setChecked(b);
1356 rviz_common::Config workspace = config.mapGetChild(
"MoveIt_Workspace");
1357 rviz_common::Config ws_center = workspace.mapGetChild(
"Center");
1359 if (ws_center.mapGetFloat(
"X", &val))
1361 if (ws_center.mapGetFloat(
"Y", &val))
1363 if (ws_center.mapGetFloat(
"Z", &val))
1366 rviz_common::Config ws_size = workspace.mapGetChild(
"Size");
1367 if (ws_size.isValid())
1369 if (ws_size.mapGetFloat(
"X", &val))
1371 if (ws_size.mapGetFloat(
"Y", &val))
1373 if (ws_size.mapGetFloat(
"Z", &val))
1379 if (
node_->get_parameter(
"default_workspace_bounds", val))
1395 config.mapSetValue(
"MoveIt_Planning_Time",
frame_->
ui_->planning_time->value());
1396 config.mapSetValue(
"MoveIt_Planning_Attempts",
frame_->
ui_->planning_attempts->value());
1397 config.mapSetValue(
"Velocity_Scaling_Factor",
frame_->
ui_->velocity_scaling_factor->value());
1398 config.mapSetValue(
"Acceleration_Scaling_Factor",
frame_->
ui_->acceleration_scaling_factor->value());
1400 config.mapSetValue(
"MoveIt_Allow_Replanning",
frame_->
ui_->allow_replanning->isChecked());
1401 config.mapSetValue(
"MoveIt_Allow_Sensor_Positioning",
frame_->
ui_->allow_looking->isChecked());
1402 config.mapSetValue(
"MoveIt_Allow_External_Program",
frame_->
ui_->allow_external_program->isChecked());
1403 config.mapSetValue(
"MoveIt_Use_Cartesian_Path",
frame_->
ui_->use_cartesian_path->isChecked());
1404 config.mapSetValue(
"MoveIt_Use_Constraint_Aware_IK",
frame_->
ui_->collision_aware_ik->isChecked());
1405 config.mapSetValue(
"MoveIt_Allow_Approximate_IK",
frame_->
ui_->approximate_ik->isChecked());
1407 rviz_common::Config workspace = config.mapMakeChild(
"MoveIt_Workspace");
1408 rviz_common::Config ws_center = workspace.mapMakeChild(
"Center");
1409 ws_center.mapSetValue(
"X",
frame_->
ui_->wcenter_x->value());
1410 ws_center.mapSetValue(
"Y",
frame_->
ui_->wcenter_y->value());
1411 ws_center.mapSetValue(
"Z",
frame_->
ui_->wcenter_z->value());
1412 rviz_common::Config ws_size = workspace.mapMakeChild(
"Size");
1413 ws_size.mapSetValue(
"X",
frame_->
ui_->wsize_x->value());
1414 ws_size.mapSetValue(
"Y",
frame_->
ui_->wsize_y->value());
1415 ws_size.mapSetValue(
"Z",
frame_->
ui_->wsize_z->value());
1428 changedPlanningGroup();
1435 place_location_shape.reset();
1443 for (std::size_t i = 0; i < place_poses.size(); ++i)
1446 std::make_shared<rviz_rendering::Shape>(rviz_rendering::Shape::Sphere, context_->getSceneManager());
1448 Ogre::Vector3 center(place_poses[i].pose.position.x, place_poses[i].pose.position.y, place_poses[i].pose.position.z);
1449 Ogre::Vector3 extents(0.02, 0.02, 0.02);
const std::vector< std::string > & getLinkModelNames() const
Get the names of the links that are part of this joint group.
const std::vector< const JointModel * > & getActiveJointModels() const
Get the active joints in this group (that have controllable DOF). This does not include mimic joints.
A joint from the robot. Models the transform that this joint applies in the kinematic chain....
A link from the robot. Contains the constant transform applied to the link and its geometry.
Representation of a robot's state. This includes position, velocity, acceleration and effort.
void setJointGroupPositions(const std::string &joint_group_name, const double *gstate)
Given positions for the variables that make up a group, in the order found in the group (including va...
void copyJointGroupPositions(const std::string &joint_group_name, std::vector< double > &gstate) const
For a given group, copy the position values of the variables that make up the group into another loca...
const JointModelGroup * getJointModelGroup(const std::string &group) const
Get the model of a particular joint group.
void setToRandomPositions()
Set all joints to random values. Values will be within default bounds.
void update(bool force=false)
Update all transforms.
void setToDefaultValues()
Set all joints to their default positions. The default position is 0, or if that is not within bounds...
void populateMenuHandler(std::shared_ptr< interactive_markers::MenuHandler > &mh)
RobotStateVisualizationPtr query_robot_start_
Handles drawing the robot at the start configuration.
void scheduleDrawQueryGoalState(robot_interaction::InteractionHandler *handler, bool error_state_changed)
kinematics_metrics::KinematicsMetricsPtr kinematics_metrics_
void changePlanningGroup(const std::string &group)
rviz_common::properties::FloatProperty * metrics_text_height_property_
void updateInternal(float wall_dt, float ros_dt) override
std::string getCurrentPlanningGroup() const
void onNewPlanningSceneState() override
This is called upon successful retrieval of the (initial) planning scene state.
void queryGoalStateChanged()
void save(rviz_common::Config config) const override
moveit::core::RobotStatePtr previous_state_
remember previous start state (updated before starting execution)
void backgroundJobUpdate(moveit::tools::BackgroundProcessing::JobEvent event, const std::string &jobname)
rviz_common::properties::BoolProperty * show_joint_torques_property_
rviz_common::PanelDockWidget * frame_dock_
void displayTable(const std::map< std::string, double > &values, const Ogre::ColourValue &color, const Ogre::Vector3 &pos, const Ogre::Quaternion &orient)
rviz_common::properties::FloatProperty * query_marker_scale_property_
void updateStateExceptModified(moveit::core::RobotState &dest, const moveit::core::RobotState &src)
void recomputeQueryStartStateMetrics()
bool text_display_for_start_
indicates whether the text display is for the start state or not
robot_interaction::RobotInteractionPtr robot_interaction_
void updateQueryGoalState()
rviz_common::properties::BoolProperty * show_manipulability_property_
void setQueryGoalState(const moveit::core::RobotState &goal)
robot_interaction::InteractionHandlerPtr query_start_state_
void drawQueryStartState()
void setStatusTextColor(const QColor &color)
std::map< std::string, LinkDisplayStatus > status_links_goal_
void clearRobotModel() override
void setQueryStartState(const moveit::core::RobotState &start)
void drawQueryGoalState()
rviz_common::properties::ColorProperty * query_outside_joint_limits_link_color_property_
void updateQueryStartState()
rviz_common::properties::FloatProperty * query_goal_alpha_property_
rviz_common::properties::ColorProperty * query_start_color_property_
void updateBackgroundJobProgressBar()
void computeMetricsInternal(std::map< std::string, double > &metrics, const robot_interaction::EndEffectorInteraction &eef, const moveit::core::RobotState &state, double payload)
void onInitialize() override
void computeMetrics(bool start, const std::string &group, double payload)
TrajectoryVisualizationPtr trajectory_visual_
rviz_rendering::MovableText * text_to_display_
rviz_common::properties::Property * path_category_
void queryStartStateChanged()
rviz_common::properties::FloatProperty * metrics_set_payload_property_
void setQueryStateHelper(bool use_start_state, const std::string &v)
std::map< std::string, bool > position_only_ik_
Some groups use position only ik, calls to the metrics have to be modified appropriately.
rviz_common::properties::ColorProperty * query_goal_color_property_
rviz_common::properties::BoolProperty * compute_weight_limit_property_
std::unique_ptr< rviz_rendering::Shape > workspace_box_
void fixedFrameChanged() override
void renderWorkspaceBox()
std::map< std::pair< bool, std::string >, std::map< std::string, double > > computed_metrics_
std::map< std::string, LinkDisplayStatus > status_links_start_
Ogre::SceneNode * text_display_scene_node_
displays texts
rviz_common::Display * int_marker_display_
void useApproximateIK(bool flag)
void updateQueryStates(const moveit::core::RobotState ¤t_state)
rviz_common::properties::EditableEnumProperty * planning_group_property_
rviz_common::properties::BoolProperty * show_manipulability_index_property_
void resetStatusTextColor()
rviz_common::properties::Property * metrics_category_
std::shared_ptr< interactive_markers::MenuHandler > menu_handler_start_
void scheduleDrawQueryStartState(robot_interaction::InteractionHandler *handler, bool error_state_changed)
std::set< std::string > modified_groups_
std::map< std::string, dynamics_solver::DynamicsSolverPtr > dynamics_solver_
std::mutex update_metrics_lock_
moveit::core::RobotStateConstPtr getQueryStartState() const
void toggleSelectPlanningGroupSubscription(bool enable)
rviz_common::properties::BoolProperty * show_workspace_property_
rviz_common::properties::BoolProperty * query_goal_state_property_
void load(const rviz_common::Config &config) override
bool isIKSolutionCollisionFree(moveit::core::RobotState *state, const moveit::core::JointModelGroup *group, const double *ik_solution) const
rviz_common::properties::FloatProperty * query_start_alpha_property_
void onDisable() override
std::vector< std::shared_ptr< rviz_rendering::Shape > > place_locations_display_
RobotStateVisualizationPtr query_robot_goal_
Handles drawing the robot at the goal configuration.
void rememberPreviousStartState()
void addStatusText(const std::string &text)
MotionPlanningFrame * frame_
void onSceneMonitorReceivedUpdate(planning_scene_monitor::PlanningSceneMonitor::SceneUpdateType update_type) override
void update(float wall_dt, float ros_dt) override
rviz_common::properties::BoolProperty * query_start_state_property_
rviz_common::properties::Property * plan_category_
std::shared_ptr< interactive_markers::MenuHandler > menu_handler_goal_
rclcpp::Subscription< std_msgs::msg::String >::SharedPtr planning_group_sub_
void recomputeQueryGoalStateMetrics()
void selectPlanningGroupCallback(const std_msgs::msg::String::ConstSharedPtr &msg)
void publishInteractiveMarkers(bool pose_update)
void onRobotModelLoaded() override
This is an event called by loadRobotModel() in the MainLoop; do not call directly.
rviz_common::properties::ColorProperty * query_colliding_link_color_property_
void visualizePlaceLocations(const std::vector< geometry_msgs::msg::PoseStamped > &place_poses)
void clearPlaceLocationsDisplay()
~MotionPlanningDisplay() override
moveit::core::RobotStateConstPtr getQueryGoalState() const
void displayMetrics(bool start)
robot_interaction::InteractionHandlerPtr query_goal_state_
std::shared_ptr< rviz_default_plugins::displays::InteractiveMarker > scene_marker_
Ui::MotionPlanningUI * ui_
void updateSceneMarkers(float wall_dt, float ros_dt)
void updateExternalCommunication()
void changePlanningGroup()
void sceneUpdate(planning_scene_monitor::PlanningSceneMonitor::SceneUpdateType update_type)
planning_scene_monitor::LockedPlanningSceneRO getPlanningSceneRO() const
get read-only access to planning scene
rclcpp::Node::SharedPtr node_
void fixedFrameChanged() override
rviz_common::properties::ColorProperty * attached_body_color_property_
void setLinkColor(const std::string &link_name, const QColor &color)
const std::string getMoveGroupNS() const
void onInitialize() override
void save(rviz_common::Config config) const override
virtual void clearRobotModel()
void onDisable() override
virtual void onRobotModelLoaded()
This is an event called by loadRobotModel() in the MainLoop; do not call directly.
void setGroupColor(rviz_default_plugins::robot::Robot *robot, const std::string &group_name, const QColor &color)
virtual void updateInternal(float wall_dt, float ros_dt)
virtual void onSceneMonitorReceivedUpdate(planning_scene_monitor::PlanningSceneMonitor::SceneUpdateType update_type)
void addMainLoopJob(const std::function< void()> &job)
queue the execution of this function for the next time the main update() loop gets called
planning_scene_monitor::PlanningSceneMonitorPtr planning_scene_monitor_
const moveit::core::RobotModelConstPtr & getRobotModel() const
void addBackgroundJob(const std::function< void()> &job, const std::string &name)
void update(float wall_dt, float ros_dt) override
void clearJobs()
remove all queued jobs
void unsetAllColors(rviz_default_plugins::robot::Robot *robot)
Ogre::SceneNode * planning_scene_node_
displays planning scene with everything in it
moveit::tools::BackgroundProcessing background_process_
virtual void changedAttachedBodyColor()
void load(const rviz_common::Config &config) override
This is a convenience class for obtaining access to an instance of a locked PlanningScene.
static const std::string DEFAULT
When used as key this means the default value.
static const std::string ALL
When used as key this means set ALL keys (including default)
Displays Interactive Markers.
Vec3fX< details::Vec3Data< double > > Vector3d
std::string append(const std::string &left, const std::string &right)
const rclcpp::Logger LOGGER
std::map< std::pair< std::string, std::string >, std::vector< Contact > > ContactMap
A map returning the pairs of body ids in contact, plus their contact details.
bool return_approximate_solution
std::string parent_group
The name of the group that sustains the end-effector (usually an arm)
kinematics::KinematicsQueryOptions options_
other options
@ RETURN_APPROXIMATE_SOLUTION
@ STATE_VALIDITY_CALLBACK
moveit::core::GroupStateValidityCallbackFn state_validity_callback_
This is called to determine if the state is valid.