Skip to content

Commit

Permalink
Removed predefined color from vector at position
Browse files Browse the repository at this point in the history
  • Loading branch information
gehrinch committed Sep 6, 2015
1 parent 186ecf8 commit 6085bd2
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions kindr_rviz_plugins/src/VectorAtPositionVisual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,34 +100,34 @@ void VectorAtPositionVisual::setMessage(const kindr_msgs::VectorAtPosition::Cons
arrow_node_->attachObject(text_.get());
}

// set color
if (msg->type == msg->TYPE_POSITION)
{
color_ = Ogre::ColourValue::Blue;
colorCanBeOverwritten_ = true;
setColor(color_.r, color_.g, color_.b, color_.a);
colorCanBeOverwritten_ = false;
}
else if (msg->type == msg->TYPE_VELOCITY || msg->type == msg->TYPE_ANGULAR_VELOCITY)
{
color_ = Ogre::ColourValue::Green;
colorCanBeOverwritten_ = true;
setColor(color_.r, color_.g, color_.b, color_.a);
colorCanBeOverwritten_ = false;
}
else if (msg->type == msg->TYPE_FORCE || msg->type == msg->TYPE_TORQUE)
{
color_ = Ogre::ColourValue::Red;
// // set color
// if (msg->type == msg->TYPE_POSITION)
// {
// color_ = Ogre::ColourValue::Blue;
// colorCanBeOverwritten_ = true;
// setColor(color_.r, color_.g, color_.b, color_.a);
// colorCanBeOverwritten_ = false;
// }
// else if (msg->type == msg->TYPE_VELOCITY || msg->type == msg->TYPE_ANGULAR_VELOCITY)
// {
// color_ = Ogre::ColourValue::Green;
// colorCanBeOverwritten_ = true;
// setColor(color_.r, color_.g, color_.b, color_.a);
// colorCanBeOverwritten_ = false;
// }
// else if (msg->type == msg->TYPE_FORCE || msg->type == msg->TYPE_TORQUE)
// {
// // color_ = Ogre::ColourValue::Red;
// colorCanBeOverwritten_ = true;
// setColor(color_.r, color_.g, color_.b, color_.a);
// colorCanBeOverwritten_ = false;
// }
// else
// {
// color_ = Ogre::ColourValue::Black;
colorCanBeOverwritten_ = true;
setColor(color_.r, color_.g, color_.b, color_.a);
colorCanBeOverwritten_ = false;
}
else
{
color_ = Ogre::ColourValue::Black;
colorCanBeOverwritten_ = true;
setColor(color_.r, color_.g, color_.b, color_.a);
}
// }
}

// Position and orientation are passed through to the SceneNode.
Expand Down Expand Up @@ -156,10 +156,10 @@ void VectorAtPositionVisual::setShowText(bool showText)
// Color is passed through to the Arrow object.
void VectorAtPositionVisual::setColor(float r, float g, float b, float a)
{
if (colorCanBeOverwritten_)
{
// if (colorCanBeOverwritten_)
// {
arrow_->setColor(r, g, b, a);
}
// }
}

// Update the scaling of the arrow.
Expand Down

0 comments on commit 6085bd2

Please sign in to comment.