45 "0 is fully transparent, 1.0 is fully opaque.",
49 "Show name of each footstep",
52 "Use Group Coloring",
false,
53 "Use footstep_group field to colorize footsteps",
57 "width of the footstep, it's not used if the dimensions is specified in Footstep message.",
61 "height of the footstep, it's not used if the dimensions is specified in Footstep message.",
66 "depth of the footstep, it's not used if the dimensions is specified in Footstep message.",
82 node->removeAndDestroyAllChildren();
83 node->detachAllObjects();
129 for (std::vector<jsk_footstep_msgs::Footstep>::const_iterator it = msg.footsteps.begin();
130 it != msg.footsteps.end();
162 for (
size_t i =
shapes_.size(); i < num; i++) {
169 else if (num <
shapes_.size()) {
176 if (num >
texts_.size()) {
178 for (
size_t i =
texts_.size(); i < num; i++) {
180 Ogre::SceneNode* node =
scene_node_->createChildSceneNode();
183 text->setVisible(
false);
186 node->attachObject(text);
191 else if (num <
texts_.size()) {
192 for (
int i =
texts_.size() - 1; i >= (int)num; i--) {
194 node->detachAllObjects();
195 node->removeAndDestroyAllChildren();
212 return std::min(a, b);
218 for (
size_t i = 0; i <
shapes_.size(); i++) {
224 std_msgs::ColorRGBA color
226 shape->setColor(color.r, color.g, color.b,
alpha_);
229 if (footstep.leg == jsk_footstep_msgs::Footstep::LLEG) {
230 shape->setColor(0, 1, 0,
alpha_);
232 else if (footstep.leg == jsk_footstep_msgs::Footstep::RLEG) {
233 shape->setColor(1, 0, 0,
alpha_);
235 else if (footstep.leg == jsk_footstep_msgs::Footstep::LARM) {
236 shape->setColor(0, 1, 1,
alpha_);
238 else if (footstep.leg == jsk_footstep_msgs::Footstep::RARM) {
239 shape->setColor(1, 0, 1,
alpha_);
242 shape->setColor(1, 1, 1,
alpha_);
250 const jsk_footstep_msgs::Footstep& footstep)
252 if (footstep.dimensions.x == 0 &&
253 footstep.dimensions.y == 0 &&
254 footstep.dimensions.z == 0) {
256 footstep.dimensions.y),
257 footstep.dimensions.z),
277 Ogre::Quaternion orientation;
278 Ogre::Vector3 position;
281 position, orientation)) {
282 std::ostringstream oss;
283 oss <<
"Error transforming pose";
284 oss <<
" from frame '" << msg->header.frame_id <<
"'";
285 oss <<
" to frame '" << qPrintable(
fixed_frame_) <<
"'";
299 for (
size_t i = 0; i < msg->footsteps.size(); i++)
304 jsk_footstep_msgs::Footstep footstep = msg->footsteps[i];
305 Ogre::Vector3 step_position;
306 Ogre::Vector3 shape_position;
307 Ogre::Quaternion step_quaternion;
312 std::ostringstream oss;
313 oss <<
"Error transforming pose";
314 oss <<
" from frame '" << msg->header.frame_id <<
"'";
315 oss <<
" to frame '" << qPrintable(
fixed_frame_) <<
"'";
321 Ogre::Vector3 step_offset (footstep.offset.x, footstep.offset.y, footstep.offset.z);
322 shape_position = step_position + (step_quaternion * step_offset);
324 shape->setPosition(shape_position);
325 shape->setOrientation(step_quaternion);
328 if (footstep.dimensions.x == 0 &&
329 footstep.dimensions.y == 0 &&
330 footstep.dimensions.z == 0) {
336 scale[0] = footstep.dimensions.x;
337 scale[1] = footstep.dimensions.y;
338 scale[2] = footstep.dimensions.z;
340 shape->setScale(scale);
342 if (footstep.leg == jsk_footstep_msgs::Footstep::LLEG) {
345 else if (footstep.leg == jsk_footstep_msgs::Footstep::RLEG) {
348 else if (footstep.leg == jsk_footstep_msgs::Footstep::LARM) {
351 else if (footstep.leg == jsk_footstep_msgs::Footstep::RARM) {
358 node->setPosition(shape_position);
359 node->setOrientation(step_quaternion);
void addPoint(const Ogre::Vector3 &point)
virtual void onInitialize()
PLUGINLIB_EXPORT_CLASS(jsk_rviz_plugins::PictogramArrayDisplay, rviz::Display)
DisplayContext * context_
virtual float getFloat() const
void setCharacterHeight(Ogre::Real height)
Ogre::SceneNode * scene_node_
virtual bool getBool() const
void setCaption(const Ogre::String &caption)
bool transform(const Header &header, const geometry_msgs::Pose &pose, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
virtual FrameManager * getFrameManager() const =0
bool validateFloats(const visualization_msgs::InteractiveMarker &msg)
void setTextAlignment(const HorizontalAlignment &horizontalAlignment, const VerticalAlignment &verticalAlignment)
void setNumLines(uint32_t num)
void setMaxPointsPerLine(uint32_t max)
Ogre::SceneManager * scene_manager_
virtual Ogre::SceneManager * getSceneManager() const =0
virtual void queueRender()=0
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
#define ROS_ERROR_STREAM(args)
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
void setLineWidth(float width)