1 #include <OGRE/OgreSceneNode.h> 2 #include <OGRE/OgreSceneManager.h> 8 #include <rviz/properties/property_manager.h> 24 , messages_received_( 0 )
25 , color_( .8, .2, .8 )
56 vis_manager_->getFrameManager()
57 ->registerFilterForTransformStatusCheck(
tf_filter_,
this );
64 for(
size_t i = 0; i <
visuals_.size(); i++ )
75 for(
size_t i = 0; i <
visuals_.size(); i++ )
82 setStatus( rviz::status_levels::Warn,
"Topic",
"No messages received" );
157 for(
size_t i = 0; i <
visuals_.size(); i++ )
190 (new_visuals.size() >
visuals_.size()) ?
191 visuals_.size() : new_visuals.size();
192 for(
size_t i = 0; i < copy_len; i++ )
196 new_visuals[ new_index ] =
visuals_[ old_index ];
201 for(
size_t i = 0; i <
visuals_.size(); i++ ) {
227 setStatus( rviz::status_levels::Ok,
"Topic",
"OK" );
231 setStatus( rviz::status_levels::Error,
"Topic",
232 std::string(
"Error subscribing: " ) + e.what() );
267 std::stringstream ss;
269 setStatus( rviz::status_levels::Ok,
"Topic", ss.str() );
274 Ogre::Quaternion orientation;
275 Ogre::Vector3 position;
276 if( !vis_manager_->getFrameManager()->getTransform( msg->header.frame_id,
278 position, orientation ))
280 ROS_DEBUG(
"Error transforming from frame '%s' to frame '%s'",
319 property_manager_->createProperty<rviz::ROSTopicStringProperty>(
"Topic",
325 setPropertyHelpText(
topic_property_,
"jsk_hark_msgs::HarkPower topic to subscribe to." );
327 topic_prop->setMessageType( ros::message_traits::datatype<jsk_hark_msgs::HarkPower>() );
336 setPropertyHelpText(
color_property_,
"Color to draw the acceleration arrows." );
345 setPropertyHelpText(
alpha_property_,
"0 is fully transparent, 1.0 is fully opaque." );
rviz::ColorPropertyWPtr color_property_
const rviz::Color & getColor()
void setTopic(const std::string &topic)
rviz::FloatPropertyWPtr bias_property_
rviz::ROSTopicStringPropertyWPtr topic_property_
rviz::IntPropertyWPtr history_length_property_
void setFramePosition(const Ogre::Vector3 &position)
void setWidth(float width)
rviz::FloatPropertyWPtr grad_property_
void setColor(const rviz::Color &color)
void setAlpha(float alpha)
PLUGINLIB_EXPORT_CLASS(jsk_rviz_plugins::PictogramArrayDisplay, rviz::Display)
void incomingMessage(const jsk_hark_msgs::HarkPower::ConstPtr &msg)
ros::NodeHandle update_nh_
tf::MessageFilter< jsk_hark_msgs::HarkPower > * tf_filter_
void setFrameOrientation(const Ogre::Quaternion &orientation)
rviz::FloatPropertyWPtr width_property_
virtual void fixedFrameChanged()
void setColor(float r, float g, float b, float a)
Ogre::SceneNode * scene_node_
virtual ~AmbientSoundDisplay()
void setHistoryLength(int history_length)
std::vector< AmbientSoundVisual * > visuals_
Ogre::SceneManager * scene_manager_
rviz::FloatPropertyWPtr scale_property_
void subscribe(ros::NodeHandle &nh, const std::string &topic, uint32_t queue_size, const ros::TransportHints &transport_hints=ros::TransportHints(), ros::CallbackQueueInterface *callback_queue=0)
const std::string & getTopic()
void setTargetFrame(const std::string &target_frame)
void setMessage(const jsk_hark_msgs::HarkPower::ConstPtr &msg)
void updateColorAndAlpha()
virtual void createProperties()
rviz::FloatPropertyWPtr alpha_property_
void setScale(float scale)
virtual void onInitialize()
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
message_filters::Subscriber< jsk_hark_msgs::HarkPower > sub_
int getHistoryLength() const
Connection registerCallback(const C &callback)