当前位置: 首页>>代码示例>>C++>>正文


C++ Matrix::eulerAngles方法代码示例

本文整理汇总了C++中eigen::Matrix::eulerAngles方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix::eulerAngles方法的具体用法?C++ Matrix::eulerAngles怎么用?C++ Matrix::eulerAngles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eigen::Matrix的用法示例。


在下文中一共展示了Matrix::eulerAngles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getYaw

double Plane::getYaw(){
	Eigen::Matrix<double,3,3> rotMat = getRotationMatrix();
	Eigen::Vector3d vector = rotMat.eulerAngles(0,1,2);
	if(vector[2]<-(M_PI*0.5)){
		vector[2]+=M_PI;
	}else if(vector[2]>(M_PI*0.5)){
		vector[2]-=M_PI;
	}
	 return vector[2];
}
开发者ID:MarkusEich,项目名称:segmentation,代码行数:10,代码来源:plane.cpp

示例2: getPose

void PositionCommand::getPose(const geometry_msgs::PoseStamped::ConstPtr & Pose)
{
    rot_matrix_= Eigen::Quaterniond(Pose->pose.orientation.w,
                                    Pose->pose.orientation.x,
                                    Pose->pose.orientation.y,
                                    Pose->pose.orientation.z).matrix();

    Eigen::Matrix<double,3,1> euler = rot_matrix_.eulerAngles(2, 1, 0);

    double yaw   = euler(0,0);
    double pitch = euler(1,0);
    double roll  = euler(2,0);

    current_pose_ <<    Pose->pose.position.x,
            Pose->pose.position.y,
            Pose->pose.position.z,
            roll,
            pitch,
            yaw;

    // if it is the first time: initialize the function
    if(init_)
    {
        ROS_INFO("initialize");
        previous_time_  = ros::Time::now();
        goal_pose_      << 0.0, 0.0, 1.0, 0.0, 0.0, 0.0;
        init_           = false;
        control_        = false;
        chirp_enable_   = false;
    }

    ros::Time current_time  = Pose->header.stamp;
    period_                 = current_time.toSec() - previous_time_.toSec();
    previous_time_          = current_time;

    control_ = true;

    control_info_msg.Period         = period_;
    control_info_msg.header.stamp   = current_time;
    control_info_pub.publish(control_info_msg);


    //    std::cout << "CP: x = " <<  current_pose_(0,0)
    //              << " y = "    <<  current_pose_(1,0)
    //              << " z = "    <<  current_pose_(2,0)
    //              << " w = "    <<  current_pose_(5,0)
    //              << std::endl;
    //    std::cout << "Period ="  <<  period_ << std::endl;
}
开发者ID:kuri-kustar,项目名称:kuri_ros_uav_commander,代码行数:49,代码来源:ChirpAndControl.cpp

示例3: getPitch

double Plane::getPitch(){
	 Eigen::Matrix<double,3,3> rotMat = getRotationMatrix();
	 Eigen::Vector3d vector = rotMat.eulerAngles(0,1,2);
	 return vector[0];
}
开发者ID:MarkusEich,项目名称:segmentation,代码行数:5,代码来源:plane.cpp


注:本文中的eigen::Matrix::eulerAngles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。