DynamicRobotModel::DynamicRobotModel()
  : rviz::Display()
  , time_since_last_transform_( 0.0f )
{ 
  visual_enabled_property_ = new rviz::Property( "Visual Enabled", true,
                                                 "Whether to display the visual representation of the robot.",
                                                 this, SLOT( updateVisualVisible() ));

  collision_enabled_property_ = new rviz::Property( "Collision Enabled", false,
                                                    "Whether to display the collision representation of the robot.",
                                                    this, SLOT( updateCollisionVisible() ));

  update_rate_property_ = new rviz::FloatProperty( "Update Interval", 0,
                                                   "Interval at which to update the links, in seconds. "
                                                   " 0 means to update every update cycle.",
                                                   this );
  update_rate_property_->setMin( 0 );

  alpha_property_ = new rviz::FloatProperty( "Alpha", 1,
                                             "Amount of transparency to apply to the links.",
                                              this, SLOT( updateAlpha() ));
  alpha_property_->setMin( 0.0 );
  alpha_property_->setMax( 1.0 );

  robot_description_topic_property_ = new rviz::RosTopicProperty( "Robot description topic", "dynamic_robot_description",
                                                                  QString::fromStdString( ros::message_traits::datatype<std_msgs::String>() ),
                                                                  "std_msgs::String topic to subscribe to.",
                                                                  this, SLOT( updateTopic() ));

  tf_prefix_property_ = new rviz::StringProperty( "TF Prefix", "",
                                                  "Robot Model normally assumes the link name is the same as the tf frame name. "
                                                  " This option allows you to set a prefix. Mainly useful for multi-robot situations.",
                                                  this, SLOT( updateTfPrefix() ));
}
示例#2
0
RobotModelDisplay::RobotModelDisplay()
  : Display()
  , has_new_transforms_( false )
  , time_since_last_transform_( 0.0f )
{
  visual_enabled_property_ = new Property( "Visual Enabled", true,
                                           "Whether to display the visual representation of the robot.",
                                           this, SLOT( updateVisualVisible() ));

  collision_enabled_property_ = new Property( "Collision Enabled", false,
                                              "Whether to display the collision representation of the robot.",
                                              this, SLOT( updateCollisionVisible() ));

  update_rate_property_ = new FloatProperty( "Update Interval", 0,
                                             "Interval at which to update the links, in seconds. "
                                             " 0 means to update every update cycle.",
                                             this );
  update_rate_property_->setMin( 0 );

  alpha_property_ = new FloatProperty( "Alpha", 1,
                                       "Amount of transparency to apply to the links.",
                                       this, SLOT( updateAlpha() ));
  alpha_property_->setMin( 0.0 );
  alpha_property_->setMax( 1.0 );

  robot_description_property_ = new StringProperty( "Robot Description", "robot_description",
                                                    "Name of the parameter to search for to load the robot description.",
                                                    this, SLOT( updateRobotDescription() ));

  tf_prefix_property_ = new StringProperty( "TF Prefix", "",
                                            "Robot Model normally assumes the link name is the same as the tf frame name. "
                                            " This option allows you to set a prefix.  Mainly useful for multi-robot situations.",
                                            this, SLOT( updateTfPrefix() ));
}