7 void footToFootMarker(
const Foot& foot,
const geometry_msgs::Vector3& foot_size,
const std_msgs::ColorRGBA& color, visualization_msgs::Marker& marker)
9 marker.header = foot.header;
10 marker.ns =
"vigir_footstep_planning/step_plan";
11 marker.type = visualization_msgs::Marker::CUBE;
12 marker.action = visualization_msgs::Marker::ADD;
14 marker.pose = foot.pose;
15 marker.pose.position.z += 0.5*foot_size.z;
16 marker.scale = foot_size;
22 void feetToFootMarkerArray(
const Feet& feet,
const geometry_msgs::Vector3& foot_size,
const std_msgs::ColorRGBA& color, visualization_msgs::MarkerArray& marker_array)
24 visualization_msgs::Marker marker;
25 marker_array.markers.clear();
28 marker_array.markers.push_back(marker);
32 marker_array.markers.push_back(marker);
35 void stepToFootMarker(
const Step& step,
const geometry_msgs::Vector3& foot_size,
const std_msgs::ColorRGBA& color, visualization_msgs::Marker& marker)
40 void stepPlanToFootMarkerArray(
const std::vector<Step>& steps,
const geometry_msgs::Vector3& foot_size, visualization_msgs::MarkerArray& marker_array,
bool add_step_index)
42 std_msgs::ColorRGBA color;
48 visualization_msgs::Marker marker;
50 marker_array.markers.clear();
52 for (std::vector<Step>::const_iterator itr = steps.begin(); itr != steps.end(); itr++)
55 color.r = itr->foot.foot_index == Foot::LEFT ? 1.0 : 0.0;
56 color.g = itr->foot.foot_index == Foot::LEFT ? 0.0 : 1.0;
60 marker_array.markers.push_back(marker);
66 marker.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
67 marker.action = visualization_msgs::Marker::ADD;
68 marker.text = boost::lexical_cast<std::string>(itr->step_index);
75 marker_array.markers.push_back(marker);
86 void feetToUpperBodyMarker(
const Feet& feet,
const geometry_msgs::Vector3& upper_body_size,
const geometry_msgs::Vector3& upper_body_origin_shift,
const std_msgs::ColorRGBA& color, visualization_msgs::Marker& marker,
bool flat)
88 marker.header = feet.header;
89 marker.ns =
"vigir_footstep_planning/upper_body";
90 marker.type = visualization_msgs::Marker::CUBE;
91 marker.action = visualization_msgs::Marker::ADD;
94 marker.pose.position.x = 0.5 * (feet.left.pose.position.x + feet.right.pose.position.x);
95 marker.pose.position.y = 0.5 * (feet.left.pose.position.y + feet.right.pose.position.y);
96 marker.pose.position.z = 0.5 * (feet.left.pose.position.z + feet.right.pose.position.z);
104 shifted = transform * shifted;
106 marker.pose.position.
x = shifted.getX();
107 marker.pose.position.y = shifted.getY();
108 marker.pose.position.z = shifted.getZ();
111 marker.pose.position.z += flat ? 0.01 : 0.5*upper_body_size.z;
112 marker.scale = upper_body_size;
114 marker.scale.z = 0.02;
115 marker.color = color;
120 void stepPlanToUpperBodyMarkerArray(
const std::vector<Step>& steps,
const geometry_msgs::Vector3& upper_body_size,
const geometry_msgs::Vector3& upper_body_origin_shift, visualization_msgs::MarkerArray& marker_array,
bool add_step_index)
122 std_msgs::ColorRGBA color;
128 visualization_msgs::Marker marker;
130 marker_array.markers.clear();
133 for (std::vector<Step>::const_iterator itr = steps.begin(); itr != steps.end(); itr++)
135 const Step&
step = *itr;
136 if (step.foot.foot_index == Foot::LEFT)
137 feet.left = step.foot;
139 feet.right = step.foot;
141 if (itr == steps.begin())
143 feet.header = step.header;
149 marker_array.markers.push_back(marker);
155 marker.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
156 marker.action = visualization_msgs::Marker::ADD;
157 marker.text = boost::lexical_cast<std::string>(itr->step_index);
158 marker.scale.z *= 0.1;
159 marker.color.r = 1.0;
160 marker.color.g = 1.0;
161 marker.color.b = 1.0;
162 marker.color.a = 0.7;
164 marker_array.markers.push_back(marker);
170 void stepPlanToUpperBodyMarkerArray(
const StepPlan& step_plan,
const geometry_msgs::Vector3& upper_body_size,
const geometry_msgs::Vector3& upper_body_origin_shift, visualization_msgs::MarkerArray& marker_array,
bool add_step_index)
179 path.header = step_plan.
header;
180 for (std::vector<Step>::const_iterator itr = step_plan.
steps.begin(); itr != step_plan.
steps.end(); itr++)
182 geometry_msgs::PoseStamped pose;
183 pose.header = step_plan.
header;
184 pose.pose = itr->foot.pose;
185 path.poses.push_back(pose);
static void poseMsgToTF(const geometry_msgs::Pose &msg, Pose &bt)
static double getYaw(const Quaternion &bt_q)
TFSIMD_FORCE_INLINE const tfScalar & x() const
static void vector3MsgToTF(const geometry_msgs::Vector3 &msg_v, Vector3 &bt_v)
static geometry_msgs::Quaternion createQuaternionMsgFromYaw(double yaw)