本文整理汇总了C++中eigen::Isometry3d::rotation方法的典型用法代码示例。如果您正苦于以下问题:C++ Isometry3d::rotation方法的具体用法?C++ Isometry3d::rotation怎么用?C++ Isometry3d::rotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::Isometry3d
的用法示例。
在下文中一共展示了Isometry3d::rotation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compareT
double compareT(Eigen::Isometry3d a, Eigen::Isometry3d b,
Eigen::VectorXd weight)
{
Eigen::Quaterniond qa(a.rotation());
Eigen::Quaterniond qb(b.rotation());
Eigen::Vector3d pa = a.translation();
Eigen::Vector3d pb = b.translation();
Eigen::VectorXd va(7), vb(7), verr(7), vScaled(7);
va << pa, qa.x(), qa.y(), qa.z(), qa.w();
vb << pb, qb.x(), qb.y(), qb.z(), qb.w();
verr = vb - va;
vScaled = weight.cwiseProduct(verr);
return vScaled.squaredNorm();
}
示例2: orientation
void VideoIMUFusion::RunningData::handleVideoTrackerReport(
const OSVR_TimeValue ×tamp, const OSVR_PoseReport &report) {
Eigen::Isometry3d roomPose = takeCameraPoseToRoom(report.pose);
#ifdef OSVR_FPE
FPExceptionEnabler fpe;
#endif
Eigen::Quaterniond orientation(roomPose.rotation());
auto oriChange = state().getQuaternion().angularDistance(orientation);
if (std::abs(oriChange) > M_PI / 2.) {
OSVR_DEV_VERBOSE("Throwing out a bad video pose");
return;
}
if (preReport(timestamp)) {
m_cameraMeasPos.setMeasurement(roomPose.translation());
osvr::kalman::correct(state(), processModel(), m_cameraMeasPos);
m_cameraMeasOri.setMeasurement(orientation);
osvr::kalman::correct(state(), processModel(), m_cameraMeasOri);
#if 0
OSVR_DEV_VERBOSE(
"State: " << state().stateVector().transpose() << "\n"
<< "Quat: "
<< state().getQuaternion().coeffs().transpose()
<< "\n"
"Error:\n"
<< state().errorCovariance());
#endif
}
}
示例3: cloud
pcl::PointCloud<pcl::PointXYZ>::Ptr Conversions::toPointCloud(const Eigen::Isometry3d &T, const image_geometry::PinholeCameraModel &cam, const cv::Mat &depth_img)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>());
cloud->header.frame_id = "cam";
cloud->is_dense = false;
cloud->height = depth_img.rows;
cloud->width = depth_img.cols;
cloud->sensor_origin_ = Eigen::Vector4f( T.translation()(0), T.translation()(1), T.translation()(2), 1.f );
cloud->sensor_orientation_ = Eigen::Quaternionf(T.rotation().cast<float>());
cloud->points.resize( cloud->height * cloud->width );
size_t idx = 0;
const float* depthdata = reinterpret_cast<float*>( &depth_img.data[0] );
for(int v = 0; v < depth_img.rows; ++v) {
for(int u = 0; u < depth_img.cols; ++u) {
pcl::PointXYZ& p = cloud->points[ idx ]; ++idx;
float d = (*depthdata++);
if (d > 0 && !isnan(d)) {
p.z = d;
p.x = (u - cam.cx()) * d / cam.fx();
p.y = (v - cam.cy()) * d / cam.fy();
} else {
p.x = std::numeric_limits<float>::quiet_NaN();
p.y = std::numeric_limits<float>::quiet_NaN();
p.z = std::numeric_limits<float>::quiet_NaN();
}
}
}
return cloud;
}
示例4: print_Isometry3d
void print_Isometry3d(Eigen::Isometry3d pose, std::stringstream &ss){
Eigen::Vector3d t(pose.translation());
Eigen::Quaterniond r(pose.rotation());
ss <<t[0]<<", "<<t[1]<<", "<<t[2]<<" | "
<<r.w()<<", "<<r.x()<<", "<<r.y()<<", "<<r.z() ;
// std::cout << ss.str() << "q\n";
}
示例5: toAffine
static Eigen::Affine3d toAffine(const Eigen::Isometry3d& pose)
{
Eigen::Affine3d p(pose.rotation());
p.translation() = pose.translation();
return p;
}
示例6: fprintf
static inline void
print_isometry(const Eigen::Isometry3d & iso)
{
const Eigen::Vector3d & t = iso.translation();
Eigen::Vector3d rpy = _quat_to_roll_pitch_yaw(Eigen::Quaterniond(iso.rotation()))*180.0/M_PI;
fprintf(stderr, "trans:(% 6.3f % 6.3f % 6.3f) rot:(% 6.3f % 6.3f % 6.3f)",t(0),t(1),t(2),rpy(0),rpy(1),rpy(2));
// dbg("rot:(% 6.3f % 6.3f % 6.3f)",rpy(0),rpy(1),rpy(2));
}
示例7: r
std::string print_Isometry3d(Eigen::Isometry3d pose){
Eigen::Vector3d t(pose.translation());
Eigen::Quaterniond r(pose.rotation());
std::stringstream ss;
ss <<t[0]<<", "<<t[1]<<", "<<t[2]<<", "
<<r.w()<<", "<<r.x()<<", "<<r.y()<<", "<<r.z() ;
return ss.str();
}
示例8: q
// converts from a SE(3) Isometry transform to a 6D vector
inline Eigen::Matrix<double, 6, 1> fromIsometry(const Eigen::Isometry3d & T){
Eigen::Matrix<double, 6, 1> v;
v.block<3,1>(0,0) = T.translation();
Eigen::Quaterniond q(T.rotation());
q.normalize();
v.block<3,1>(3,0) = q.vec();
return v;
}
示例9: print_Isometry3d
void print_Isometry3d(Eigen::Isometry3d pose, std::stringstream &ss){
Eigen::Vector3d t(pose.translation());
Eigen::Quaterniond r(pose.rotation());
double rpy[3];
quat_to_euler(r, rpy[0], rpy[1], rpy[2]);
ss <<t[0]<<", "<<t[1]<<", "<<t[2]<<" | "
<<r.w()<<", "<<r.x()<<", "<<r.y()<<", "<<r.z() << " | RPY "
<< rpy[0] <<", "<< rpy[1] <<", "<< rpy[2];
}
示例10: string
std::string
isometryToString(const Eigen::Isometry3d& m)
{
char result[80];
memset(result, 0, sizeof(result));
Eigen::Vector3d xyz = m.translation();
Eigen::Vector3d rpy = m.rotation().eulerAngles(0, 1, 2);
snprintf(result, 79, "%6.2f %6.2f %6.2f %6.2f %6.2f %6.2f",
xyz(0), xyz(1), xyz(2),
rpy(0) * 180/M_PI, rpy(1) * 180/M_PI, rpy(2) * 180/M_PI);
return std::string(result);
}
示例11: r
std::string print_Isometry3d(Eigen::Isometry3d pose){
Eigen::Vector3d t(pose.translation());
Eigen::Quaterniond r(pose.rotation());
double rpy[3];
quat_to_euler(r, rpy[0], rpy[1], rpy[2]);
std::stringstream ss;
ss <<t[0]<<", "<<t[1]<<", "<<t[2]<<", "
<<r.w()<<", "<<r.x()<<", "<<r.y()<<", "<<r.z() << ", "
<< rpy[0] <<", "<< rpy[1] <<", "<< rpy[2];
return ss.str();
}
示例12: getPoseAsBotPose
bot_core::pose_t getPoseAsBotPose(Eigen::Isometry3d pose, int64_t utime){
bot_core::pose_t pose_msg;
pose_msg.utime = utime;
pose_msg.pos[0] = pose.translation().x();
pose_msg.pos[1] = pose.translation().y();
pose_msg.pos[2] = pose.translation().z();
Eigen::Quaterniond r_x(pose.rotation());
pose_msg.orientation[0] = r_x.w();
pose_msg.orientation[1] = r_x.x();
pose_msg.orientation[2] = r_x.y();
pose_msg.orientation[3] = r_x.z();
return pose_msg;
}
示例13: odomInfo
OdomTransPtr RGBDVisOdometry::Isometry3DToOdomTrans(Eigen::Isometry3d info)
{
Eigen::Vector3d xyz = info.translation();
Eigen::Vector3d rpy = info.rotation().eulerAngles(0, 1, 2);
OdomTransPtr odomInfo(new OdomTrans);
odomInfo->x = xyz(0);
odomInfo->y = xyz(1);
odomInfo->z = xyz(2);
odomInfo->alpha = rpy(0);
odomInfo->beta = rpy(1);
odomInfo->gamma = rpy(2);
return odomInfo;
}
示例14: compute_velocity
void compute_velocity(const Eigen::Vector3d& v_parent,
const Eigen::Vector3d& w_parent,
const Eigen::Vector3d& v_rel,
const Eigen::Vector3d& w_rel,
const Eigen::Vector3d& offset,
const Eigen::Isometry3d& tf_parent,
Eigen::Vector3d& v_child,
Eigen::Vector3d& w_child)
{
const Eigen::Matrix3d& R = tf_parent.rotation();
v_child = v_parent + R*v_rel + w_parent.cross(R*offset);
w_child = w_parent + R*w_rel;
}
示例15: doWork
void App::doWork(){
std::vector<float> xA;
std::vector<float> yA;
readCSVFile(cl_cfg_.filenameA, xA, yA);
std::cout << xA.size() << " points in File A\n";
lidarOdom_->doOdometry(xA, yA, xA.size(), 0);
// Match second scan without a prior
std::string i;
cout << "Match B: Continue? ";
cin >> i;
std::vector<float> xB;
std::vector<float> yB;
readCSVFile(cl_cfg_.filenameB, xB, yB);
std::cout << xB.size() << " points in File B\n";
lidarOdom_->doOdometry(xB, yB, xB.size(), 1);
// Match third scan giving a prior rotation for the heading
// this alignment would otherwise fail:
cout << "Match C: Continue? ";
cin >> i;
std::vector<float> xC;
std::vector<float> yC;
readCSVFile(cl_cfg_.filenameC, xC, yC);
std::cout << xC.size() << " points in File C\n";
ScanTransform prior;
prior.x = 0;
prior.y = 0;
prior.theta = 1.7;
lidarOdom_->doOdometry(xC, yC, xC.size(), 2, &prior);
// 2. Determine the body position using the LIDAR motion estimate:
Eigen::Isometry3d pose = lidarOdom_->getCurrentPose();
Eigen::Quaterniond orientation(pose.rotation());
Eigen::Vector3d rpy = orientation.matrix().eulerAngles(0,1,2);
std::cout << "\n";
std::cout << "x,y,yaw (m,m,deg): "<< pose.translation().x() << ", " << pose.translation().y()
<< ", "
<< rpy[2]*180/M_PI << "\n";
}