add points «number» field to Plan msg
This commit is contained in:
parent
191c614fda
commit
a3d8f76af6
2 changed files with 5 additions and 2 deletions
|
@ -2,3 +2,4 @@ Header header
|
||||||
geometry_msgs/Point normal
|
geometry_msgs/Point normal
|
||||||
float64 altitude
|
float64 altitude
|
||||||
float64 curvature
|
float64 curvature
|
||||||
|
int64 number
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Callback {
|
||||||
|
|
||||||
// publication
|
// publication
|
||||||
ROS_INFO("Plan published");
|
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) :
|
Callback(ros::Publisher& pub) :
|
||||||
|
@ -43,7 +43,8 @@ class Callback {
|
||||||
const hand_control::Plan::ConstPtr
|
const hand_control::Plan::ConstPtr
|
||||||
to_Plan(const float& x, const float& y,
|
to_Plan(const float& x, const float& y,
|
||||||
const float& z, const float& h,
|
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());
|
hand_control::Plan::Ptr ros_msg(new hand_control::Plan());
|
||||||
ros_msg->normal.x = x;
|
ros_msg->normal.x = x;
|
||||||
|
@ -51,6 +52,7 @@ class Callback {
|
||||||
ros_msg->normal.z = z;
|
ros_msg->normal.z = z;
|
||||||
ros_msg->altitude = h;
|
ros_msg->altitude = h;
|
||||||
ros_msg->curvature = c;
|
ros_msg->curvature = c;
|
||||||
|
ros_msg->number = number;
|
||||||
// uint64_t msec64 is in ms (10-6)
|
// uint64_t msec64 is in ms (10-6)
|
||||||
uint64_t sec64 = msec64 / 1000000;
|
uint64_t sec64 = msec64 / 1000000;
|
||||||
uint64_t nsec64 = (msec64 % 1000000) * 1000;
|
uint64_t nsec64 = (msec64 % 1000000) * 1000;
|
||||||
|
|
Loading…
Reference in a new issue