39 #include <visualization_msgs/msg/interactive_marker_feedback.hpp>
40 #include <visualization_msgs/msg/interactive_marker.hpp>
41 #include <interactive_markers/menu_handler.hpp>
55 class InteractiveMarkerServer;
78 RobotInteraction(
const moveit::core::RobotModelConstPtr& robot_model,
const rclcpp::Node::SharedPtr& node,
79 const std::string& ns =
"");
100 const std::string&
name =
"");
152 return kinematic_options_map_;
169 void decideActiveEndEffectors(
const std::string&
group);
173 void decideActiveJoints(
const std::string&
group);
175 void moveInteractiveMarker(
const std::string&
name,
const geometry_msgs::msg::PoseStamped& msg);
177 void registerMoveInteractiveMarkerTopic(
const std::string& marker_name,
const std::string&
name);
179 double computeLinkMarkerSize(
const std::string& link);
181 double computeGroupMarkerSize(
const std::string&
group);
184 geometry_msgs::msg::Pose& control_to_eef_tf)
const;
187 visualization_msgs::msg::InteractiveMarker& im,
bool position =
true,
188 bool orientation =
true);
190 const geometry_msgs::msg::Pose& offset, visualization_msgs::msg::InteractiveMarker& im,
191 bool position =
true,
bool orientation =
true);
194 processInteractiveMarkerFeedback(
const visualization_msgs::msg::InteractiveMarkerFeedback::ConstSharedPtr& feedback);
195 void subscribeMoveInteractiveMarker(
const std::string marker_name,
const std::string&
name);
196 void processingThread();
197 void clearInteractiveMarkersUnsafe();
199 std::unique_ptr<std::thread> processing_thread_;
200 bool run_processing_thread_;
202 std::condition_variable new_feedback_condition_;
203 std::map<std::string, visualization_msgs::msg::InteractiveMarkerFeedback::ConstSharedPtr> feedback_map_;
205 moveit::core::RobotModelConstPtr robot_model_;
207 std::vector<EndEffectorInteraction> active_eef_;
208 std::vector<JointInteraction> active_vj_;
209 std::vector<GenericInteraction> active_generic_;
211 std::map<std::string, InteractionHandlerPtr> handlers_;
212 std::map<std::string, std::size_t> shown_markers_;
222 std::mutex marker_access_lock_;
224 interactive_markers::InteractiveMarkerServer* int_marker_server_;
226 std::vector<rclcpp::Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr> int_marker_move_subscribers_;
229 std::vector<std::string> int_marker_move_topics_;
231 std::vector<std::string> int_marker_names_;
234 rclcpp::Node::SharedPtr node_;
237 KinematicOptionsMapPtr kinematic_options_map_;
Representation of a robot's state. This includes position, velocity, acceleration and effort.
void publishInteractiveMarkers()
void clearInteractiveMarkers()
void updateInteractiveMarkers(const InteractionHandlerPtr &handler)
void decideActiveComponents(const std::string &group)
void toggleMoveInteractiveMarkerTopic(bool enable)
KinematicOptionsMapPtr getKinematicOptionsMap()
const std::vector< EndEffectorInteraction > & getActiveEndEffectors() const
const std::vector< JointInteraction > & getActiveJoints() const
const std::string & getServerTopic() const
virtual ~RobotInteraction()
RobotInteraction(const moveit::core::RobotModelConstPtr &robot_model, const rclcpp::Node::SharedPtr &node, const std::string &ns="")
bool showingMarkers(const InteractionHandlerPtr &handler)
void addActiveComponent(const InteractiveMarkerConstructorFn &construct, const ProcessFeedbackFn &process, const InteractiveMarkerUpdateFn &update=InteractiveMarkerUpdateFn(), const std::string &name="")
void addInteractiveMarkers(const InteractionHandlerPtr &handler, const double marker_scale=0.0)
const moveit::core::RobotModelConstPtr & getRobotModel() const
static const std::string INTERACTIVE_MARKER_TOPIC
The topic name on which the internal Interactive Marker Server operates.
MOVEIT_CLASS_FORWARD(InteractionHandler)
std::function< bool(moveit::core::RobotState &state, const visualization_msgs::msg::InteractiveMarkerFeedback::ConstSharedPtr &feedback)> ProcessFeedbackFn
std::function< bool(const moveit::core::RobotState &, geometry_msgs::msg::Pose &)> InteractiveMarkerUpdateFn
std::function< bool(const moveit::core::RobotState &state, visualization_msgs::msg::InteractiveMarker &marker)> InteractiveMarkerConstructorFn