add points «number» field to Plan msg

This commit is contained in:
Louis-Guillaume DUBOIS 2015-05-07 22:37:47 +02:00
parent 191c614fda
commit a3d8f76af6
2 changed files with 5 additions and 2 deletions

View file

@ -2,3 +2,4 @@ Header header
geometry_msgs/Point normal
float64 altitude
float64 curvature
int64 number

View file

@ -29,7 +29,7 @@ class Callback {
// publication
ROS_INFO("Plan published");
publisher.publish(to_Plan(x, y, z, h, c, msg->header.seq, msg->header.stamp));
publisher.publish(to_Plan(x, y, z, h, c, msg->header.seq, msg->header.stamp, msg->width));
}
Callback(ros::Publisher& pub) :
@ -43,7 +43,8 @@ class Callback {
const hand_control::Plan::ConstPtr
to_Plan(const float& x, const float& y,
const float& z, const float& h,
const float& c, uint32_t seq, uint64_t msec64)
const float& c, uint32_t seq,
uint64_t msec64, uint64_t number)
{
hand_control::Plan::Ptr ros_msg(new hand_control::Plan());
ros_msg->normal.x = x;
@ -51,6 +52,7 @@ class Callback {
ros_msg->normal.z = z;
ros_msg->altitude = h;
ros_msg->curvature = c;
ros_msg->number = number;
// uint64_t msec64 is in ms (10-6)
uint64_t sec64 = msec64 / 1000000;
uint64_t nsec64 = (msec64 % 1000000) * 1000;