7 void publishFeet(
ros::Publisher& pub,
const msgs::Feet& feet,
const geometry_msgs::Vector3& foot_size,
const std_msgs::ColorRGBA& color)
9 visualization_msgs::MarkerArray marker_array;
10 msgs::feetToFootMarkerArray(feet, foot_size, color, marker_array);
16 std_msgs::ColorRGBA color;
26 std_msgs::ColorRGBA color;
34 void publishStepPlan(
ros::Publisher& pub,
const msgs::StepPlan& step_plan,
const geometry_msgs::Vector3& foot_size, visualization_msgs::MarkerArray& last_step_plan_vis,
bool add_step_index)
36 visualization_msgs::MarkerArray step_plan_vis;
37 msgs::stepPlanToFootMarkerArray(step_plan, foot_size, step_plan_vis, add_step_index);
40 if (last_step_plan_vis.markers.size() < step_plan_vis.markers.size())
41 last_step_plan_vis.markers.resize(step_plan_vis.markers.size());
44 for (
size_t i = 0; i < step_plan_vis.markers.size(); i++)
45 last_step_plan_vis.markers[i] = step_plan_vis.markers[i];
48 for (
size_t i = step_plan_vis.markers.size(); i < last_step_plan_vis.markers.size(); i++)
49 last_step_plan_vis.markers[i].action = visualization_msgs::Marker::DELETE;
52 pub.
publish(last_step_plan_vis);
55 last_step_plan_vis.markers.resize(step_plan_vis.markers.size());
58 void publishUpperBody(
ros::Publisher& pub,
const msgs::StepPlan& step_plan,
const geometry_msgs::Vector3& upper_body_size,
const geometry_msgs::Vector3& upper_body_origin_shift, visualization_msgs::MarkerArray& last_upper_body_vis,
bool add_step_index)
60 visualization_msgs::MarkerArray upper_body_vis;
61 msgs::stepPlanToUpperBodyMarkerArray(step_plan, upper_body_size, upper_body_origin_shift, upper_body_vis, add_step_index);
64 if (last_upper_body_vis.markers.size() < upper_body_vis.markers.size())
65 last_upper_body_vis.markers.resize(upper_body_vis.markers.size());
68 for (
size_t i = 0; i < upper_body_vis.markers.size(); i++)
69 last_upper_body_vis.markers[i] = upper_body_vis.markers[i];
72 for (
size_t i = upper_body_vis.markers.size(); i < last_upper_body_vis.markers.size(); i++)
73 last_upper_body_vis.markers[i].action = visualization_msgs::Marker::DELETE;
76 pub.
publish(last_upper_body_vis);
79 last_upper_body_vis.markers.resize(upper_body_vis.markers.size());
85 msgs::stepPlanToPath(step_plan, path);
91 visualization_msgs::MarkerArray marker_array;
92 visualization_msgs::Marker marker;
94 marker.header = header;
95 marker.type = visualization_msgs::Marker::CUBE;
96 marker.action = visualization_msgs::Marker::DELETE;
99 marker_array.markers.push_back(marker);
101 marker_array.markers.push_back(marker);
108 for (std::vector<visualization_msgs::Marker>::iterator itr = last_step_plan_vis.markers.begin(); itr != last_step_plan_vis.markers.end(); itr++)
109 itr->action = visualization_msgs::Marker::DELETE;
110 pub.
publish(last_step_plan_vis);
116 path.header = header;
123 pcl::PointCloud<pcl::PointXYZ> point_cloud;
124 point_cloud.resize(recently_visited_steps.size());
126 for (
unsigned long i = 0; i < recently_visited_steps.size(); i++)
128 pcl::PointXYZ& point = point_cloud.points[i];
129 copyPosition(recently_visited_steps[i].foot.pose.position, point);
133 sensor_msgs::PointCloud2 point_cloud_msgs;
135 point_cloud_msgs.header = header;
142 pcl::PointCloud<pcl::PointXYZI> point_cloud;
143 point_cloud.resize(visited_steps.size());
147 for (std::vector<msgs::Step>::const_iterator itr = visited_steps.begin(); itr != visited_steps.end(); itr++, i++)
149 pcl::PointXYZI& point = point_cloud.points[i];
150 copyPosition(itr->foot.pose.position, point);
151 point.intensity = std::min(5.0, (current_time - itr->header.stamp).toSec());
155 sensor_msgs::PointCloud2 point_cloud_msgs;
157 point_cloud_msgs.header = header;
163 std::vector<msgs::Step> vec;
164 for (std::set<msgs::Step, StepMsgVisCompare>::const_iterator itr = visited_steps.begin(); itr != visited_steps.end(); itr++)
void publish(const boost::shared_ptr< M > &message) const
void toROSMsg(const sensor_msgs::PointCloud2 &cloud, sensor_msgs::Image &image)