38 markerTop.header.frame_id =
"calibration_center";
41 markerTop.type = visualization_msgs::Marker::LINE_LIST;
42 markerTop.action = visualization_msgs::Marker::ADD;
54 markerBottom.type = visualization_msgs::Marker::LINE_LIST;
104 visualization_msgs::Marker deleteMarker;
105 deleteMarker.action = visualization_msgs::Marker::DELETE;
107 deleteMarker.header.frame_id =
"calibration_center";
116 visualization_msgs::Marker deleteMarker2;
117 deleteMarker2.action = visualization_msgs::Marker::DELETE;
118 deleteMarker2.header.frame_id =
"calibration_center";
120 deleteMarker2.header.stamp =
ros::Time();
121 deleteMarker2.id = 0;
122 pubMarkerPosition.publish(deleteMarker2);
123 deleteMarker2.id = 1;
124 pubMarkerPosition.publish(deleteMarker2);
126 visualization_msgs::Marker deleteMarker_camera;
127 deleteMarker_camera.action = visualization_msgs::Marker::DELETE;
128 deleteMarker_camera.header.frame_id =
"calibration_center";
130 deleteMarker_camera.header.stamp =
ros::Time();
131 deleteMarker_camera.id = 0;
132 pubCameraPosition.publish(deleteMarker_camera);
134 ROS_INFO(
"Marker publisher initialized.");
145 geometry_msgs::Point A, B, C, D;
146 Eigen::Matrix4d markerBase;
148 A.x = markerBase(0,3) + markerBase(0,0)*edgeSize*0.5 + markerBase(0,1)*edgeSize*0.5;
149 A.y = markerBase(1,3) + markerBase(1,0)*edgeSize*0.5 + markerBase(1,1)*edgeSize*0.5;
150 A.z = markerBase(2,3) + markerBase(2,0)*edgeSize*0.5 + markerBase(2,1)*edgeSize*0.5;
151 B.x = markerBase(0,3) - markerBase(0,0)*edgeSize*0.5 + markerBase(0,1)*edgeSize*0.5;
152 B.y = markerBase(1,3) - markerBase(1,0)*edgeSize*0.5 + markerBase(1,1)*edgeSize*0.5;
153 B.z = markerBase(2,3) - markerBase(2,0)*edgeSize*0.5 + markerBase(2,1)*edgeSize*0.5;
154 C.x = markerBase(0,3) - markerBase(0,0)*edgeSize*0.5 - markerBase(0,1)*edgeSize*0.5;
155 C.y = markerBase(1,3) - markerBase(1,0)*edgeSize*0.5 - markerBase(1,1)*edgeSize*0.5;
156 C.z = markerBase(2,3) - markerBase(2,0)*edgeSize*0.5 - markerBase(2,1)*edgeSize*0.5;
157 D.x = markerBase(0,3) + markerBase(0,0)*edgeSize*0.5 - markerBase(0,1)*edgeSize*0.5;
158 D.y = markerBase(1,3) + markerBase(1,0)*edgeSize*0.5 - markerBase(1,1)*edgeSize*0.5;
159 D.z = markerBase(2,3) + markerBase(2,0)*edgeSize*0.5 - markerBase(2,1)*edgeSize*0.5;
171 geometry_msgs::Point A_, B_, C_, D_;
172 A_.x = markerBase(0,3) + markerBase(0,0)*edgeSize*0.5 + markerBase(0,1)*edgeSize*0.5;
173 A_.y = markerBase(1,3) + markerBase(1,0)*edgeSize*0.5 + markerBase(1,1)*edgeSize*0.5;
174 A_.z = markerBase(2,3) + markerBase(2,0)*edgeSize*0.5 + markerBase(2,1)*edgeSize*0.5;
175 B_.x = markerBase(0,3) - markerBase(0,0)*edgeSize*0.5 + markerBase(0,1)*edgeSize*0.5;
176 B_.y = markerBase(1,3) - markerBase(1,0)*edgeSize*0.5 + markerBase(1,1)*edgeSize*0.5;
177 B_.z = markerBase(2,3) - markerBase(2,0)*edgeSize*0.5 + markerBase(2,1)*edgeSize*0.5;
178 C_.x = markerBase(0,3) - markerBase(0,0)*edgeSize*0.5 - markerBase(0,1)*edgeSize*0.5;
179 C_.y = markerBase(1,3) - markerBase(1,0)*edgeSize*0.5 - markerBase(1,1)*edgeSize*0.5;
180 C_.z = markerBase(2,3) - markerBase(2,0)*edgeSize*0.5 - markerBase(2,1)*edgeSize*0.5;
181 D_.x = markerBase(0,3) + markerBase(0,0)*edgeSize*0.5 - markerBase(0,1)*edgeSize*0.5;
182 D_.y = markerBase(1,3) + markerBase(1,0)*edgeSize*0.5 - markerBase(1,1)*edgeSize*0.5;
183 D_.z = markerBase(2,3) + markerBase(2,0)*edgeSize*0.5 - markerBase(2,1)*edgeSize*0.5;
220 if (!activeLeft && !activeRight)
222 visualization_msgs::Marker deleteMarker_camera;
223 deleteMarker_camera.action = visualization_msgs::Marker::DELETE;
224 deleteMarker_camera.header.frame_id =
"calibration_center";
226 deleteMarker_camera.header.stamp =
ros::Time();
227 deleteMarker_camera.id = 0;
238 for (
unsigned int i = 0; i < camFrames->size(); i++)
241 Eigen::Matrix4d tempMatrix = cCF.
pose;
242 visualization_msgs::Marker tempMarker;
243 tempMarker.header.frame_id =
"calibration_center";
246 tempMarker.type = visualization_msgs::Marker::ARROW;
247 tempMarker.action = visualization_msgs::Marker::ADD;
249 tempMarker.color.r = cCF.
color.r;
250 tempMarker.color.g = cCF.
color.g;
251 tempMarker.color.b = cCF.
color.b;
252 tempMarker.color.a = cCF.
color.a;
256 tempMarker.pose.orientation.w = 1.0;
259 Eigen::Vector3d tempVec(tempMatrix(0,2), tempMatrix(1,2), tempMatrix(2,2));
263 geometry_msgs::Point p1, p2;
265 p1.x = tempMatrix(0,3);
266 p1.y = tempMatrix(1,3);
267 p1.z = tempMatrix(2,3);
268 p2.x = tempMatrix(0,3) + tempVec[0];
269 p2.y = tempMatrix(1,3) + tempVec[1];
270 p2.z = tempMatrix(2,3) + tempVec[2];
271 tempMarker.points.push_back(p1);
272 tempMarker.points.push_back(p2);
280 visualization_msgs::Marker arrowMarker;
281 arrowMarker.header.frame_id =
"calibration_center";
284 arrowMarker.type = visualization_msgs::Marker::ARROW;
285 arrowMarker.action = visualization_msgs::Marker::ADD;
286 arrowMarker.color.a = 1.0f;
289 arrowMarker.color.r = 0.0f;
290 arrowMarker.color.g = 1.0f;
294 arrowMarker.color.r = 1.0f;
295 arrowMarker.color.g = 0.0f;
297 arrowMarker.color.b = 0.0f;
301 arrowMarker.pose.orientation.w = 1.0;
303 geometry_msgs::Point p1, p2;
304 p1.x = startPoint[0];
305 p1.y = startPoint[1];
306 p1.z = startPoint[2];
310 arrowMarker.points.push_back(p1);
311 arrowMarker.points.push_back(p2);
322 Eigen::Vector3d tempVector;
323 geometry_msgs::Point A_,B_, C_, A, B, C, TOP;
336 tempVector = Eigen::Vector3d(baseA[0] - top[0], baseA[1] - top[1], - top[2]);
337 tempVector.normalize();
342 tempVector = Eigen::Vector3d(baseB[0] - top[0], baseB[1] - top[1], - top[2]);
343 tempVector.normalize();
348 tempVector = Eigen::Vector3d(baseC[0] - top[0], baseC[1] - top[1], - top[2]);
349 tempVector.normalize();
380 if (triangles->size() > 1)
384 geometry_msgs::Point A,B;
387 for (
unsigned int i = 0 ; i < triangles->size() - 1; i++)
391 A.x = (triangles->at(i))[0];
392 A.y = (triangles->at(i))[1];
393 B.x = (triangles->at(i+1))[0];
394 B.y = (triangles->at(i+1))[1];
void publish(const boost::shared_ptr< M > &message) const
void publishColouredCameraFrames(std::vector< colouredCameraFrame, Eigen::aligned_allocator< colouredCameraFrame > > *camFrames)
void publishTriangles(std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > *triangles)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Matrix4d pose
void publishCameraFramePointer(const Eigen::Vector3d &startPoint, const Eigen::Vector3d &endPoint, bool isValid)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
visualization_msgs::Marker markerTop
void publishTetrahedon(const Eigen::Vector2d &baseA, const Eigen::Vector2d &baseB, const Eigen::Vector2d &baseC, const Eigen::Vector3d &top)
std_msgs::ColorRGBA color
visualization_msgs::Marker markerARMarker_Left
visualization_msgs::Marker markerBottom
void publishARMarkers(bool activeLeft, bool activeRight, const Eigen::Matrix4d topFrame)
boost::shared_ptr< Calibration_Object > calibrationObject
ros::Publisher pubObjectPosition
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Publisher pubMarkerPosition
MarkerPublisher(boost::shared_ptr< Calibration_Object > calibrationObject)
#define ROS_INFO_STREAM(args)
visualization_msgs::Marker markerTriangles
visualization_msgs::Marker markerARMarker_Right
ros::Publisher pubCameraPosition