EnvironmentVisualization.cpp
Go to the documentation of this file.
1 
19 
20 namespace Visualization {
21 
23 
24  ros::NodeHandle n("~");
25 
26  // Init publisher for visualization markers
27  meshesPublisher = n.advertise<visualization_msgs::Marker>("dome_meshes", 0);
28  }
29 
31 
33  visualization_msgs::Marker m;
34 
35  // Create and publish a visualization marker for the dome model
36  m.header.frame_id = "/PTU";
37  m.header.stamp = ros::Time::now();
38  m.ns = "dome_meshes";
39  m.action = visualization_msgs::Marker::ADD;
40  m.type = visualization_msgs::Marker::MESH_RESOURCE;
41  m.mesh_resource = "package://asr_visualization_server/res/dome.dae";
42  m.id = ID_DOME;
43 
44  m.scale.x = m.scale.y = m.scale.z = 0.1;
45  m.color.r = m.color.g = m.color.b = 0.7f;
46  m.color.a = 1.0f;
47 
48  tf::Quaternion q = tf::createQuaternionFromRPY(-1.5708, 0.0, -0.7854); // -90°, 0°, -45°
49  m.pose.orientation.x = q.x();
50  m.pose.orientation.y = q.y();
51  m.pose.orientation.z = q.z();
52  m.pose.orientation.w = q.w();
53 
54  m.pose.position.x = 0.3;
55  m.pose.position.y = -1.15;
56  m.pose.position.z = 1.85;
57 
59  }
60 
62  visualization_msgs::Marker m;
63 
64  m.header.frame_id = "/PTU";
65  m.header.stamp = ros::Time::now();
66  m.ns = "dome_meshes";
67  m.action = visualization_msgs::Marker::ADD;
68  m.type = visualization_msgs::Marker::MESH_RESOURCE;
69  m.mesh_resource = "package://asr_visualization_server/res/table.dae";
70  m.id = ID_TABLE;
71 
72  m.scale.x = m.scale.y = m.scale.z = 0.1;
73  m.color.r = m.color.g = m.color.b = 0.7f;
74  m.color.a = 1.0f;
75 
76  tf::Quaternion qTable = tf::createQuaternionFromRPY(-1.5708, 0.0, 0.7854); // -90°, 0°, 45°
77  m.pose.orientation.x = qTable.x();
78  m.pose.orientation.y = qTable.y();
79  m.pose.orientation.z = qTable.z();
80  m.pose.orientation.w = qTable.w();
81 
82  m.pose.position.x = -0.5;
83  m.pose.position.y = -1.4;
84  m.pose.position.z = 1.825;
85 
87  }
88 
89 }
static tf::Quaternion createQuaternionFromRPY(double roll, double pitch, double yaw)
void publish(const boost::shared_ptr< M > &message) const
static const int ID_TABLE
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
static const int ID_DOME
static Time now()


asr_psm_visualizations
Author(s): Gehrung Joachim, Meißner Pascal
autogenerated on Sat Nov 9 2019 03:49:12