23#include <tf2/transform_datatypes.h>
25#include <moveit_msgs/srv/get_position_ik.hpp>
27#include <visualization_msgs/msg/marker_array.hpp>
31template <
typename AsyncCB,
typename Orthogonal>
37template <
typename AsyncCB,
typename Orthogonal>
65 const std::vector<geometry_msgs::msg::PoseStamped> & endEffectorTrajectory,
66 std::optional<std::string> tipLink = std::nullopt);
68 template <
typename TOrthogonal,
typename TSourceObject>
73 smacc2::SmaccAsyncClientBehavior::onOrthogonalAllocation<TOrthogonal, TSourceObject>();
78 ev->trajectory = traj;
85 ev->trajectory = traj;
91 RCLCPP_INFO_STREAM(
getLogger(),
"[" << this->
getName() <<
"] motion execution failed");
93 this->postEvent<EvMoveGroupMotionExecutionFailed<TSourceObject, TOrthogonal>>();
97 virtual void onEntry()
override;
99 virtual void onExit()
override;
101 virtual void update()
override;
105 moveit_msgs::msg::RobotTrajectory & computedJointTrajectory);
108 const moveit_msgs::msg::RobotTrajectory & computedJointTrajectory);
121 std::string globalFrame, tf2::Stamped<tf2::Transform> & currentEndEffectorTransform);
126 rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr
markersPub_;
130 rclcpp::Client<moveit_msgs::srv::GetPositionIK>::SharedPtr
iksrv_;
virtual void onExit() override
std::optional< std::string > tipLink_
void onOrthogonalAllocation()
ClMoveit2z * movegroupClient_
std::optional< bool > allowInitialTrajectoryStateJointDiscontinuity_
std::function< void(moveit_msgs::msg::RobotTrajectory &)> postJointDiscontinuityEvent
virtual void generateTrajectory()=0
std::function< void(moveit_msgs::msg::RobotTrajectory &)> postIncorrectInitialStateEvent
std::function< void()> postMotionExecutionFailureEvents
virtual void onEntry() override
std::vector< geometry_msgs::msg::PoseStamped > endEffectorTrajectory_
ComputeJointTrajectoryErrorCode computeJointSpaceTrajectory(moveit_msgs::msg::RobotTrajectory &computedJointTrajectory)
std::optional< std::string > group_
void executeJointSpaceTrajectory(const moveit_msgs::msg::RobotTrajectory &computedJointTrajectory)
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr markersPub_
void getCurrentEndEffectorPose(std::string globalFrame, tf2::Stamped< tf2::Transform > ¤tEndEffectorTransform)
virtual void update() override
visualization_msgs::msg::MarkerArray beahiorMarkers_
virtual void createMarkers()
rclcpp::Client< moveit_msgs::srv::GetPositionIK >::SharedPtr iksrv_
std::atomic< bool > markersInitialized_
void postEventMotionExecutionFailed()
std::string getName() const
virtual rclcpp::Logger getLogger() const
ComputeJointTrajectoryErrorCode
@ INCORRECT_INITIAL_STATE
@ JOINT_TRAJECTORY_DISCONTINUITY
moveit_msgs::msg::RobotTrajectory trajectory
moveit_msgs::msg::RobotTrajectory trajectory