MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / publish

Method publish

opt_calibration/src/opt_calibration.cpp:291–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291void OPTCalibration::publish()
292{
293 for (size_t i = 0; i < node_vec_.size(); ++i)
294 {
295 TreeNode::Ptr sensor_node = node_vec_[i];
296 geometry_msgs::TransformStamped transform_msg;
297 if (sensor_node->sensor()->toTF(transform_msg))
298 tf_pub_.sendTransform(transform_msg);
299 }
300
301 for (size_t i = 0; i < checkerboard_vec_.size(); ++i)
302 {
303 cb::Checkerboard::Ptr checkerboard = checkerboard_vec_[i];
304 visualization_msgs::Marker marker;
305 checkerboard->toMarker(marker);
306 marker.ns = "optimized checkerboard";
307 marker.id = i;
308 marker_pub_.publish(marker);
309 }
310
311 if (floor_estimated_)
312 {
313 cb::Vector3 floor_origin = -floor_.normal() * floor_.offset();
314 cb::Vector3 floor_x = (floor_.projection(floor_origin + cb::Vector3::UnitX()) - floor_origin).normalized();
315
316 cb::Transform floor_pose;
317 floor_pose.linear().col(2) = floor_.normal();
318 floor_pose.linear().col(0) = floor_x;
319 floor_pose.linear().col(1) = floor_pose.linear().col(2).cross(floor_pose.linear().col(0));
320 floor_pose.translation() = floor_origin;
321
322 cb::PlanarObject plane("/floor");
323 plane.transform(floor_pose);
324 plane.setParent(world_);
325
326 visualization_msgs::Marker marker;
327 plane.toMarker(marker);
328 marker.ns = "floor";
329 marker.id = 0;
330 marker.scale.x = 10;
331 marker.scale.y = 10;
332 marker_pub_.publish(marker);
333
334 geometry_msgs::TransformStamped transform_msg;
335 if (plane.toTF(transform_msg))
336 tf_pub_.sendTransform(transform_msg);
337 }
338
339}
340
341bool OPTCalibration::estimateFloor()
342{

Callers 15

callbackFunction · 0.80
spin_onceMethod · 0.80
track_callbackMethod · 0.80
publish_namesMethod · 0.80
callbackMethod · 0.80
callbackMethod · 0.80
callbackMethod · 0.80
imageCbMethod · 0.80
imageCbMethod · 0.80
imageCbMethod · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 4

normalMethod · 0.80
offsetMethod · 0.80
transformMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected