30 #include <Eigen/Geometry> 31 #include <rclcpp/rclcpp.hpp> 32 #include <tf2_eigen/tf2_eigen.h> 33 #include <sensor_msgs/msg/joint_state.hpp> 34 #include <geometry_msgs/msg/pose_stamped.hpp> 64 ArmControlBase(
const std::string node_name,
const rclcpp::NodeOptions & options)
65 : Node(node_name, options)
67 joint_pub_ = this->create_publisher<sensor_msgs::msg::JointState>(
"/joint_states", 1);
90 virtual bool moveToTcpPose(
double x,
double y,
double z,
92 double vel,
double acc) = 0;
101 virtual bool moveToTcpPose(
const Eigen::Isometry3d& pose,
double vel,
double acc);
108 virtual bool open(
const double distance = 0) = 0;
115 virtual bool close(
const double distance = 0) = 0;
140 virtual bool pick(
double x,
double y,
double z,
141 double alpha,
double beta,
double gamma,
142 double vel,
double acc,
double vel_scale,
double approach);
162 virtual bool pick(
const geometry_msgs::msg::PoseStamped& pose_stamped,
163 double vel,
double acc,
double vel_scale,
double approach);
187 virtual bool place(
double x,
double y,
double z,
188 double alpha,
double beta,
double gamma,
189 double vel,
double acc,
double vel_scale,
double retract);
208 virtual bool place(
const geometry_msgs::msg::PoseStamped& pose_stamped,
209 double vel,
double acc,
double vel_scale,
double retract);
217 void toTcpPose(
const geometry_msgs::msg::PoseStamped& pose_stamped,
TcpPose& tcp_pose);
225 void toTcpPose(
const Eigen::Isometry3d& pose,
TcpPose& tcp_pose);
233 virtual bool checkTcpGoalArrived(Eigen::Isometry3d& tcp_goal);
238 virtual void parseArgs() = 0;
243 virtual bool startLoop() = 0;
247 rclcpp::Publisher<sensor_msgs::msg::JointState>::SharedPtr
joint_pub_;
ArmControlBase(const std::string node_name, const rclcpp::NodeOptions &options)
Constructor of class ArmControlBase.
Definition: control_base.hpp:64
TcpPose tcp_pose_
Current end-effctor pose.
Definition: control_base.hpp:251
Data type to represent robot arm's end-effector pose in 3D cartesian space.
Definition: control_base.hpp:42
Robot arm control interface.
Definition: control_base.hpp:55
double y
Definition: control_base.hpp:45
double x
Definition: control_base.hpp:44
double beta
Definition: control_base.hpp:48
rclcpp::Publisher< sensor_msgs::msg::JointState >::SharedPtr joint_pub_
Joint state publisher.
Definition: control_base.hpp:247
virtual ~ArmControlBase()
Default destructor of class ArmControlBase.
Definition: control_base.hpp:74
double gamma
Definition: control_base.hpp:49
double alpha
Definition: control_base.hpp:47
double z
Definition: control_base.hpp:46
std::mutex m_
Mutex to guard the tcp_pose usage.
Definition: control_base.hpp:253
double time_out_
Time duration to finish a pick or place task.
Definition: control_base.hpp:255
std::vector< std::string > joint_names_
Joint names.
Definition: control_base.hpp:249