ROS学习笔记(七)::RVIZ::Interactive Markers: Basic Controls

作者:u011104647


1.Interactive Markers: Basic Controls基本控件

说明:这篇教程说明base_controls教程代码如何工作


2.basic_controls教程说明:


本教程介绍你在设计交互标志物时最常用的选项。节点将从RViz得到的所有反馈打印到命令行上。

 所有交互标志物包含一个灰色盒子。在大多数情况下,这个灰色盒子会与对照的其余控件一起移动。它会告诉你互动标志物的坐标系如何移动。


3.Simple 6-DOF control简单六自由度控件

这显示了如何控件使用6个独立控件,控件6个自由度。使用环去旋转和箭头移动的结构。


4.Simple 6-DOF control (fixed orientation)简单的六自由度控件(固定方向)


与简单六自由度控件相同,除了控件方向将保持固定,被控件的坐标系的方向独立。

https://raw.github.com/ros-visualization/visualization_tutorials/groovy-devel/interactive_marker_tutorials/src/basic_controls.cpp

  48 Marker makeBox( InteractiveMarker &msg )
  49 {
  50   Marker marker;
  51 
  52   marker.type = Marker::CUBE;
  53   marker.scale.x = msg.scale * 0.45;
  54   marker.scale.y = msg.scale * 0.45;
  55   marker.scale.z = msg.scale * 0.45;
  56   marker.color.r = 0.5;
  57   marker.color.g = 0.5;
  58   marker.color.b = 0.5;
  59   marker.color.a = 1.0;
  60 
  61   return marker;
  62 }
  63 
  64 InteractiveMarkerControl& makeBoxControl( InteractiveMarker &msg )
  65 {
  66   InteractiveMarkerControl control;
  67   control.always_visible = true;
  68   control.markers.push_back( makeBox(msg) );
  69   msg.controls.push_back( control );
  70 
  71   return msg.controls.back();
  72 }

 

https://raw.github.com/ros-visualization/visualization_tutorials/groovy-devel/interactive_marker_tutorials/src/basic_controls.cpp
 
 183 void make6DofMarker( bool fixed, unsigned int interaction_mode, const tf::Vector3& position, bool show_6dof )
 184 {
 185   InteractiveMarker int_marker;
 186   int_marker.header.frame_id = "base_link";
 187   tf::pointTFToMsg(position, int_marker.pose.position);
 188   int_marker.scale = 1;
 189 
 190   int_marker.name = "simple_6dof";
 191   int_marker.description = "Simple 6-DOF Control";
 192 
 193   // insert a box
 194   makeBoxControl(int_marker);
 195   int_marker.controls[0].interaction_mode = interaction_mode;
 196 
 197   InteractiveMarkerControl control;
 198 
 199   if ( fixed )
 200   {
 201     int_marker.name += "_fixed";