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"
77 #include <rclcpp/qos.hpp>
81 static const rclcpp::Logger
LOGGER = rclcpp::get_logger(
"moveit_ros_visualization.motion_planning_display");
88 , text_to_display_(nullptr)
90 , frame_dock_(nullptr)
93 , int_marker_display_(nullptr)
96 plan_category_ =
new rviz_common::properties::Property(
"Planning Request", QVariant(),
"",
this);
97 metrics_category_ =
new rviz_common::properties::Property(
"Planning Metrics", QVariant(),
"",
this);
98 path_category_ =
new rviz_common::properties::Property(
"Planned Path", QVariant(),
"",
this);
102 new rviz_common::properties::BoolProperty(
"Show Weight Limit",
false,
103 "Shows the weight limit at a particular pose for an end-effector",
107 new rviz_common::properties::BoolProperty(
"Show Manipulability Index",
false,
109 SLOT(changedShowManipulabilityIndex()),
this);
112 new rviz_common::properties::BoolProperty(
"Show Manipulability",
false,
114 SLOT(changedShowManipulability()),
this);
117 new rviz_common::properties::BoolProperty(
"Show Joint Torques",
false,
118 "Shows the joint torques for a given configuration and payload",
122 new rviz_common::properties::FloatProperty(
"Payload", 1.0f,
"Specify the payload at the end effector (kg)",
127 "TextHeight", 0.08f,
"Text height",
metrics_category_, SLOT(changedMetricsTextHeight()),
this);
133 "Planning Group",
"",
"The name of the group of links to plan for (from the ones defined in the SRDF)",
136 "Shows the axis-aligned bounding box for "
137 "the workspace allowed for planning",
140 new rviz_common::properties::BoolProperty(
"Query Start State",
false,
141 "Set a custom start state for the motion planning query",
144 new rviz_common::properties::BoolProperty(
"Query Goal State",
true,
145 "Shows the goal state for the motion planning query",
plan_category_,
146 SLOT(changedQueryGoalState()),
this);
148 "Interactive Marker Size", 0.0f,
149 "Specifies scale of the interactive marker overlaid on the robot. 0 is auto scale.",
plan_category_,
150 SLOT(changedQueryMarkerScale()),
this);
154 new rviz_common::properties::ColorProperty(
"Start State Color", QColor(0, 255, 0),
156 SLOT(changedQueryStartColor()),
this);
158 new rviz_common::properties::FloatProperty(
"Start State Alpha", 1.0f,
"Specifies the alpha for the robot links",
164 new rviz_common::properties::ColorProperty(
"Goal State Color", QColor(250, 128, 0),
166 SLOT(changedQueryGoalColor()),
this);
169 new rviz_common::properties::FloatProperty(
"Goal State Alpha", 1.0f,
"Specifies the alpha for the robot links",
175 new rviz_common::properties::ColorProperty(
"Colliding Link Color", QColor(255, 0, 0),
177 SLOT(changedQueryCollidingLinkColor()),
this);
180 "Joint Violation Color", QColor(255, 0, 255),
181 "The highlight color for child links of joints that are outside bounds",
plan_category_,
182 SLOT(changedQueryJointViolationColor()),
this);
218 std::make_shared<RobotStateVisualization>(
planning_scene_node_, context_,
"Planning Request Start",
nullptr);
222 std_msgs::msg::ColorRGBA color;
224 color.r = qcolor.redF();
225 color.g = qcolor.greenF();
226 color.b = qcolor.blueF();
231 std::make_shared<RobotStateVisualization>(
planning_scene_node_, context_,
"Planning Request Goal",
nullptr);
236 color.r = qcolor.redF();
237 color.g = qcolor.greenF();
238 color.b = qcolor.blueF();
241 rviz_common::WindowManagerInterface* window_context = context_->getWindowManager();
244 connect(
frame_, SIGNAL(configChanged()), this->getModel(), SIGNAL(configChanged()));
254 connect(
frame_dock_, SIGNAL(visibilityChanged(
bool)),
this, SLOT(motionPanelVisibilityChange(
bool)));
263 text_to_display_->setTextAlignment(rviz_rendering::MovableText::H_CENTER, rviz_rendering::MovableText::V_CENTER);
270 if (context_ && context_->getWindowManager() && context_->getWindowManager()->getParentWindow())
272 QShortcut* im_reset_shortcut =
273 new QShortcut(QKeySequence(
"Ctrl+I"), context_->getWindowManager()->getParentWindow());
274 connect(im_reset_shortcut, SIGNAL(activated()),
this, SLOT(resetInteractiveMarkers()));
278 void MotionPlanningDisplay::motionPanelVisibilityChange(
bool enable)
289 "/rviz/moveit/select_planning_group", rclcpp::ServicesQoS(),
316 bool enabled = this->isEnabled();
336 QProgressBar*
p =
frame_->
ui_->background_job_progress;
347 if (
p->maximum() < n)
354 p->setValue(
p->maximum() - n);
359 void MotionPlanningDisplay::changedShowWeightLimit()
373 void MotionPlanningDisplay::changedShowManipulabilityIndex()
387 void MotionPlanningDisplay::changedShowManipulability()
401 void MotionPlanningDisplay::changedShowJointTorques()
415 void MotionPlanningDisplay::changedMetricsSetPayload()
429 void MotionPlanningDisplay::changedMetricsTextHeight()
435 const Ogre::Vector3& pos,
const Ogre::Quaternion& orient)
438 std::stringstream ss;
439 for (
const std::pair<const std::string, double>& value : values)
440 ss << boost::format(
"%-10s %-4.2f") % value.first % value.second <<
'\n';
442 if (ss.str().empty())
468 workspace_box_ = std::make_unique<rviz_rendering::Shape>(rviz_rendering::Shape::Cube, context_->getSceneManager(),
473 Ogre::Vector3 center(
frame_->
ui_->wcenter_x->value(),
frame_->
ui_->wcenter_y->value(),
484 const std::vector<robot_interaction::EndEffectorInteraction>& eef =
robot_interaction_->getActiveEndEffectors();
491 if (ee.parent_group ==
group)
500 dynamics_solver::DynamicsSolverPtr ds;
509 unsigned int saturated_joint;
510 std::vector<double> joint_values;
512 if (ds->getMaxPayload(joint_values, max_payload, saturated_joint))
514 metrics[
"max_payload"] = max_payload;
515 metrics[
"saturated_joint"] = saturated_joint;
517 std::vector<double> joint_torques;
518 joint_torques.resize(joint_values.size());
519 if (ds->getPayloadTorques(joint_values, payload, joint_torques))
521 for (std::size_t i = 0; i < joint_torques.size(); ++i)
523 std::stringstream stream;
524 stream <<
"torque[" << i <<
"]";
525 metrics[stream.str()] = joint_torques[i];
535 double manipulability_index, manipulability;
538 metrics[
"manipulability_index"] = manipulability_index;
540 metrics[
"manipulability"] = manipulability;
546 inline void copyItemIfExists(
const std::map<std::string, double>& source, std::map<std::string, double>&
dest,
547 const std::string& key)
549 std::map<std::string, double>::const_iterator it = source.find(key);
550 if (it != source.end())
551 dest[key] = it->second;
560 static const Ogre::Quaternion
ORIENTATION(1.0, 0.0, 0.0, 0.0);
561 const std::vector<robot_interaction::EndEffectorInteraction>& eef =
robot_interaction_->getActiveEndEffectors();
569 Ogre::Vector3 position(0.0, 0.0, 0.0);
570 std::map<std::string, double> text_table;
571 const std::map<std::string, double>& metrics_table =
computed_metrics_[std::make_pair(start, ee.parent_group)];
574 copyItemIfExists(metrics_table, text_table,
"max_payload");
575 copyItemIfExists(metrics_table, text_table,
"saturated_joint");
578 copyItemIfExists(metrics_table, text_table,
"manipulability_index");
580 copyItemIfExists(metrics_table, text_table,
"manipulability");
583 std::size_t nj =
getRobotModel()->getJointModelGroup(ee.parent_group)->getJointModelNames().size();
584 for (
size_t j = 0; j < nj; ++j)
586 std::stringstream stream;
587 stream <<
"torque[" << j <<
"]";
588 copyItemIfExists(metrics_table, text_table, stream.str());
599 const Eigen::Vector3d& t = state->getGlobalLinkTransform(lm).translation();
602 position[2] = t.z() + 0.2;
628 std::vector<std::string> collision_links;
631 for (
const std::string& collision_link : collision_links)
633 if (!collision_links.empty())
639 for (collision_detection::CollisionResult::ContactMap::const_iterator it = pairs.begin(); it != pairs.end();
649 std::vector<std::string> outside_bounds;
652 if (!state->satisfiesBounds(jmodel, jmodel->getMaximumExtent() * 1e-2))
654 outside_bounds.push_back(jmodel->getChildLinkModel()->getName());
657 if (!outside_bounds.empty())
660 addStatusText(
"Links descending from joints that are outside bounds in start state:");
672 context_->queueRender();
683 frame_->
ui_->status_text->setTextColor(color);
689 frame_->
ui_->status_text->append(QString::fromStdString(
text));
694 for (
const std::string& it :
text)
712 void MotionPlanningDisplay::changedQueryStartState()
722 void MotionPlanningDisplay::changedQueryGoalState()
747 std::vector<std::string> collision_links;
750 for (
const std::string& collision_link : collision_links)
752 if (!collision_links.empty())
758 for (collision_detection::CollisionResult::ContactMap::const_iterator it = pairs.begin(); it != pairs.end();
770 std::vector<std::string> outside_bounds;
772 if (!state->satisfiesBounds(jmodel, jmodel->getMaximumExtent() * 1e-2))
774 outside_bounds.push_back(jmodel->getChildLinkModel()->getName());
778 if (!outside_bounds.empty())
781 addStatusText(
"Links descending from joints that are outside bounds in goal state:");
794 context_->queueRender();
797 void MotionPlanningDisplay::resetInteractiveMarkers()
833 void MotionPlanningDisplay::changedQueryStartColor()
835 std_msgs::msg::ColorRGBA color;
837 color.r = qcolor.redF();
838 color.g = qcolor.greenF();
839 color.b = qcolor.blueF();
842 changedQueryStartState();
845 void MotionPlanningDisplay::changedQueryStartAlpha()
848 changedQueryStartState();
851 void MotionPlanningDisplay::changedQueryMarkerScale()
863 void MotionPlanningDisplay::changedQueryGoalColor()
865 std_msgs::msg::ColorRGBA color;
867 color.r = qcolor.redF();
868 color.g = qcolor.greenF();
869 color.b = qcolor.blueF();
872 changedQueryGoalState();
875 void MotionPlanningDisplay::changedQueryGoalAlpha()
878 changedQueryGoalState();
881 void MotionPlanningDisplay::changedQueryCollidingLinkColor()
883 changedQueryStartState();
884 changedQueryGoalState();
887 void MotionPlanningDisplay::changedQueryJointViolationColor()
889 changedQueryStartState();
890 changedQueryGoalState();
893 void MotionPlanningDisplay::changedAttachedBodyColor()
902 bool error_state_changed)
907 "publishInteractiveMarkers");
912 bool error_state_changed)
917 "publishInteractiveMarkers");
926 context_->queueRender();
934 context_->queueRender();
968 const double* ik_solution)
const
991 for (std::map<std::string, LinkDisplayStatus>::const_iterator it =
status_links_start_.begin();
999 for (std::map<std::string, LinkDisplayStatus>::const_iterator it =
status_links_goal_.begin();
1019 RCLCPP_ERROR(LOGGER,
"Group [%s] not found in the robot model.",
group.c_str());
1022 void MotionPlanningDisplay::changedPlanningGroup()
1046 void MotionPlanningDisplay::changedWorkspace()
1060 std::string v =
"<" + state_name +
">";
1062 if (v ==
"<random>")
1067 else if (v ==
"<current>")
1071 state = ps->getCurrentState();
1073 else if (v ==
"<same as goal>")
1077 else if (v ==
"<same as start>")
1093 typedef interactive_markers::MenuHandler immh;
1094 std::vector<std::string> state_names;
1095 state_names.push_back(
"random");
1096 state_names.push_back(
"current");
1097 state_names.push_back(
"same as start");
1098 state_names.push_back(
"same as goal");
1104 immh::EntryHandle menu_states =
1105 mh->insert(is_start ?
"Set start state to" :
"Set goal state to", immh::FeedbackCallback());
1106 for (
const std::string& state_name : state_names)
1109 if ((state_name ==
"same as start" && is_start) || (state_name ==
"same as goal" && !is_start))
1111 mh->insert(menu_states, state_name,
1150 const double* joint_group_variable_values) {
1185 const std::vector<std::string>& groups =
getRobotModel()->getJointModelGroupNames();
1187 for (
const std::string&
group : groups)
1196 geometry_msgs::msg::Vector3 gravity_vector;
1197 gravity_vector.x = 0.0;
1198 gravity_vector.y = 0.0;
1199 gravity_vector.z = 9.81;
1202 for (
const std::string&
group : groups)
1205 std::make_shared<dynamics_solver::DynamicsSolver>(
getRobotModel(),
group, gravity_vector);
1208 frame_->fillPlanningGroupOptions();
1209 changedPlanningGroup();
1213 frame_->onNewPlanningSceneState();
1225 std::vector<double> values_to_keep;
1226 dest.copyJointGroupPositions(jmg, values_to_keep);
1334 if (config.mapGetFloat(
"MoveIt_Planning_Time", &
d))
1337 if (config.mapGetInt(
"MoveIt_Planning_Attempts", &attempts))
1338 frame_->
ui_->planning_attempts->setValue(attempts);
1339 if (config.mapGetFloat(
"Velocity_Scaling_Factor", &
d))
1340 frame_->
ui_->velocity_scaling_factor->setValue(
d);
1341 if (config.mapGetFloat(
"Acceleration_Scaling_Factor", &
d))
1342 frame_->
ui_->acceleration_scaling_factor->setValue(
d);
1345 if (config.mapGetBool(
"MoveIt_Allow_Replanning", &b))
1346 frame_->
ui_->allow_replanning->setChecked(b);
1347 if (config.mapGetBool(
"MoveIt_Allow_Sensor_Positioning", &b))
1348 frame_->
ui_->allow_looking->setChecked(b);
1349 if (config.mapGetBool(
"MoveIt_Allow_External_Program", &b))
1350 frame_->
ui_->allow_external_program->setChecked(b);
1351 if (config.mapGetBool(
"MoveIt_Use_Cartesian_Path", &b))
1352 frame_->
ui_->use_cartesian_path->setChecked(b);
1353 if (config.mapGetBool(
"MoveIt_Use_Constraint_Aware_IK", &b))
1354 frame_->
ui_->collision_aware_ik->setChecked(b);
1355 if (config.mapGetBool(
"MoveIt_Allow_Approximate_IK", &b))
1356 frame_->
ui_->approximate_ik->setChecked(b);
1358 rviz_common::Config workspace = config.mapGetChild(
"MoveIt_Workspace");
1359 rviz_common::Config ws_center = workspace.mapGetChild(
"Center");
1361 if (ws_center.mapGetFloat(
"X", &val))
1363 if (ws_center.mapGetFloat(
"Y", &val))
1365 if (ws_center.mapGetFloat(
"Z", &val))
1368 rviz_common::Config ws_size = workspace.mapGetChild(
"Size");
1369 if (ws_size.isValid())
1371 if (ws_size.mapGetFloat(
"X", &val))
1373 if (ws_size.mapGetFloat(
"Y", &val))
1375 if (ws_size.mapGetFloat(
"Z", &val))
1381 if (
node_->get_parameter(
"default_workspace_bounds", val))
1397 config.mapSetValue(
"MoveIt_Planning_Time",
frame_->
ui_->planning_time->value());
1398 config.mapSetValue(
"MoveIt_Planning_Attempts",
frame_->
ui_->planning_attempts->value());
1399 config.mapSetValue(
"Velocity_Scaling_Factor",
frame_->
ui_->velocity_scaling_factor->value());
1400 config.mapSetValue(
"Acceleration_Scaling_Factor",
frame_->
ui_->acceleration_scaling_factor->value());
1402 config.mapSetValue(
"MoveIt_Allow_Replanning",
frame_->
ui_->allow_replanning->isChecked());
1403 config.mapSetValue(
"MoveIt_Allow_Sensor_Positioning",
frame_->
ui_->allow_looking->isChecked());
1404 config.mapSetValue(
"MoveIt_Allow_External_Program",
frame_->
ui_->allow_external_program->isChecked());
1405 config.mapSetValue(
"MoveIt_Use_Cartesian_Path",
frame_->
ui_->use_cartesian_path->isChecked());
1406 config.mapSetValue(
"MoveIt_Use_Constraint_Aware_IK",
frame_->
ui_->collision_aware_ik->isChecked());
1407 config.mapSetValue(
"MoveIt_Allow_Approximate_IK",
frame_->
ui_->approximate_ik->isChecked());
1409 rviz_common::Config workspace = config.mapMakeChild(
"MoveIt_Workspace");
1410 rviz_common::Config ws_center = workspace.mapMakeChild(
"Center");
1411 ws_center.mapSetValue(
"X",
frame_->
ui_->wcenter_x->value());
1412 ws_center.mapSetValue(
"Y",
frame_->
ui_->wcenter_y->value());
1413 ws_center.mapSetValue(
"Z",
frame_->
ui_->wcenter_z->value());
1414 rviz_common::Config ws_size = workspace.mapMakeChild(
"Size");
1415 ws_size.mapSetValue(
"X",
frame_->
ui_->wsize_x->value());
1416 ws_size.mapSetValue(
"Y",
frame_->
ui_->wsize_y->value());
1417 ws_size.mapSetValue(
"Z",
frame_->
ui_->wsize_z->value());
1430 changedPlanningGroup();
1437 place_location_shape.reset();
1445 for (std::size_t i = 0; i < place_poses.size(); ++i)
1448 std::make_shared<rviz_rendering::Shape>(rviz_rendering::Shape::Sphere, context_->getSceneManager());
1450 Ogre::Vector3 center(place_poses[i].pose.position.x, place_poses[i].pose.position.y, place_poses[i].pose.position.z);
1451 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.