20 #include <std_msgs/Float64.h> 21 #include <std_msgs/Float64MultiArray.h> 41 std_msgs::Float64 positions;
42 positions.data = msg->data[0];
48 const uint8_t POINT_SIZE = 4 + 1;
49 static uint32_t points = 0;
51 static uint8_t wait_for_pub = 0;
52 static uint8_t loop_cnt = 0;
59 if (loop_cnt < wait_for_pub)
66 for (uint32_t positions = points + 1; positions < (points + POINT_SIZE); positions++)
68 std_msgs::Float64 joint_position;
75 points = points + POINT_SIZE;
80 if (points >= all_points_cnt)
94 pb = nh.
advertise<std_msgs::Float64>(
"joint1_position/command", 10);
97 pb = nh.
advertise<std_msgs::Float64>(
"joint2_position/command", 10);
100 pb = nh.
advertise<std_msgs::Float64>(
"joint3_position/command", 10);
103 pb = nh.
advertise<std_msgs::Float64>(
"joint4_position/command", 10);
106 pb = nh.
advertise<std_msgs::Float64>(
"gripper_position/command", 10);
116 int main(
int argc,
char **argv)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
int main(int argc, char **argv)
std_msgs::Float64MultiArray joint_trajectory_point_
ros::Subscriber joint_trajectory_point_sub_
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void initSubscriber(ros::NodeHandle nh)
void jointTrajectoryPointCallback(const std_msgs::Float64MultiArray::ConstPtr &msg)
void initPublisher(ros::NodeHandle nh)
ROSCPP_DECL void spin(Spinner &spinner)
void publishCallback(const ros::TimerEvent &)
void gripperPositionCallback(const std_msgs::Float64MultiArray::ConstPtr &msg)
std::vector< ros::Publisher > gazebo_goal_joint_position_pub_
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
const float CONTROL_PERIOD
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Subscriber gripper_position_sub_