5#include <pcl/common/transforms.h>
6#include <pcl/point_cloud.h>
8#include <VirtualRobot/Robot.h>
23 template <
class Po
intT>
25 pcl::PointCloud<PointT>& targetCloud,
26 const std::string& sourceFrame,
27 const std::string& targetFrame,
28 const VirtualRobot::RobotConstPtr& robot);
34 template <
class _Po
intT>
58 cloud(pointCloudPtr), frame(frameName)
97 changeFrame(
const std::string& newFrame,
const VirtualRobot::RobotConstPtr& robot)
100 this->frame = newFrame;
106 pcl::transformPointCloud(*
cloud, *
cloud, transform);
121 template <
class Po
intCloudPtrT>
125 template <
class Po
intCloudPtrT>
131template <
class Po
intT>
134 pcl::PointCloud<PointT>& targetCloud,
135 const std::string& sourceFrame,
136 const std::string& targetFrame,
137 const VirtualRobot::RobotConstPtr& robot)
139 if (sourceFrame != targetFrame)
141 armarx::FramedPose framedPose(Eigen::Matrix4f::Identity(), sourceFrame, robot->getName());
143 const Eigen::Matrix4f sourceToTarget = framedPose.
toEigen();
144 pcl::transformPointCloud(sourceCloud, targetCloud, sourceToTarget);
Eigen::Matrix4f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
virtual Eigen::Matrix4f toEigen() const
A point cloud which keeps track of its reference coordinate frame and allows changing frames using ar...
armarx::FramedPose getFramedPose(const VirtualRobot::RobotConstPtr &robot) const
pcl::PointCloud< PointT > PointCloudT
FramedPointCloud(PointCloudPtrT pointCloudPtr)
Construct a framed point cloud managing given point cloud in global frame.
void setFrameWithoutTransformation(const std::string &f)
FramedPointCloud(PointCloudPtrT pointCloudPtr, const std::string &frameName)
Construct a framed point cloud managing given point cloud residing in given frame.
armarx::FramedPose getFramedPose(const std::string &agentName) const
Get the current pose as FramedPose.
FramedPointCloud(const std::string &frameName)
Construct an empty point cloud residing in given frame.
void transformBy(const Eigen::Matrix4f &transform)
FramedPointCloud()=default
Construct an empty point cloud in global frame.
PointCloudPtrT cloud
The point cloud.
void changeFrame(const std::string &newFrame, const VirtualRobot::RobotConstPtr &robot)
Transform the point cloud from the current frame to the new frame using the given reference robot.
typename PointCloudT::Ptr PointCloudPtrT
Eigen::Matrix4f getGlobalPose(const VirtualRobot::RobotConstPtr &robot) const
Get the current global pose.
std::string getFrame() const
Get the current frame.
std::string const GlobalFrame
Variable of the global coordinate system.
void transformPointCloudFromTo(const pcl::PointCloud< PointT > &sourceCloud, pcl::PointCloud< PointT > &targetCloud, const std::string &sourceFrame, const std::string &targetFrame, const VirtualRobot::RobotConstPtr &robot)
Transform a point cloud from a robot frame to another.
FramedPointCloud(PointCloudPtrT pointCloudPtr) -> FramedPointCloud< typename PointCloudPtrT::element_type::PointType >