24 arm_action_server_(nh_,
25 "arm_controller/follow_joint_trajectory",
28 gripper_action_server_(nh_,
29 "gripper_controller/follow_joint_trajectory",
46 trajectory_msgs::JointTrajectory jnt_tra = goal->trajectory;
47 std_msgs::Float64MultiArray jnt_tra_pts;
49 uint32_t jnt_tra_pts_size = jnt_tra.points.size();
50 const uint8_t POINTS_STEP_SIZE = 10;
51 uint32_t steps = floor((
double)jnt_tra_pts_size/(
double)POINTS_STEP_SIZE);
53 for (uint32_t i = 0; i < jnt_tra_pts_size; i = i + steps)
55 jnt_tra_pts.data.push_back(jnt_tra.points[i].time_from_start.toSec());
56 for (std::vector<uint32_t>::size_type j = 0; j < jnt_tra.points[i].positions.size(); j++)
58 jnt_tra_pts.data.push_back(jnt_tra.points[i].positions[j]);
68 trajectory_msgs::JointTrajectory jnt_tra = goal->trajectory;
69 std_msgs::Float64MultiArray jnt_tra_pts;
71 uint32_t jnt_tra_pts_size = jnt_tra.points.size();
72 jnt_tra_pts.data.push_back(jnt_tra.points[jnt_tra_pts_size-1].positions[0]);
78 int main(
int argc,
char **argv)
80 ros::init(argc, argv,
"turtlebot3_manipulation_bringup");
void publish(const boost::shared_ptr< M > &message) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void setSucceeded(const Result &result=Result(), const std::string &text=std::string(""))
ros::Publisher joint_trajectory_point_pub_
actionlib::SimpleActionServer< control_msgs::FollowJointTrajectoryAction > gripper_action_server_
ros::Publisher gripper_pub_
void gripperActionCallback(const control_msgs::FollowJointTrajectoryGoalConstPtr &msg)
int main(int argc, char **argv)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
actionlib::SimpleActionServer< control_msgs::FollowJointTrajectoryAction > arm_action_server_
~Turtlebot3ManipulationBringup()
Turtlebot3ManipulationBringup()
void armActionCallback(const control_msgs::FollowJointTrajectoryGoalConstPtr &msg)