setting marker for given period time fails
I am trying to visualize a specific marker for few period of time, but when i try this code it shows error:
error: no match for ‘operator=’ (operand types are ‘visualization_msgs::Marker_<std::allocator<void> >::_lifetime_type {aka ros::Duration}’ and ‘int’)
points.scale.y = 0.01; points.lifetime=1;
My codes are:
visualization_msgs::Marker points, line_strip, line_list;
points.header.frame_id = line_strip.header.frame_id = line_list.header.frame_id = "/camera_depth_frame"; points.header.stamp = line_strip.header.stamp = line_list.header.stamp = ros::Time::now();
points.ns = line_strip.ns = line_list.ns = "lines";
points.action =line_strip.action = line_list.action = visualization_msgs::Marker::ADD;
points.pose.orientation.w = line_strip.pose.orientation.w = line_list.pose.orientation.w = 1.0;
points.id = 0;
line_strip.id = 1;
line_list.id = 2;
points.type = visualization_msgs::Marker::POINTS;
line_strip.type = visualization_msgs::Marker::LINE_STRIP;
line_list.type = visualization_msgs::Marker::LINE_LIST;
points.scale.x = 0.01;
points.scale.y = 0.01; points.lifetime=1;
How can i use this lifetime parameter? For eg. here i was trying to set lifetime of points as 1 sec.