#include"ros/ros.h" #include"nav_msgs/Odometry.h" using namespace std; #include#include #include #include #include // Vector3d Quaterniond2Euler(const double x,const double y,const double z,const double w) // { // Eigen::Quaterniond q; // q.x() = x; // q.y() = y; // q.z() = z; // q.w() = w; // Eigen::Vector3d euler = q.toRotationMatrix().eulerAngles(2, 1, 0); // cout << "Quaterniond2Euler result is:" < pose.pose.position.x; init_pos_1.y=gps_msg->pose.pose.position.y; init_pos_1.z=gps_msg->pose.pose.position.z; // 求取当前pose与起点距离 double distance; distance=pow((init_pos_1.x-init_pos_.x),2)+pow((init_pos_1.y-init_pos_.y),2);//2*2; distance=sqrt(distance); cout<<"distance="< pose.pose.orientation.x; q.y()=gps_msg->pose.pose.orientation.y; q.z()=gps_msg->pose.pose.orientation.z; q.w()=gps_msg->pose.pose.orientation.w; // 方法1:——失败 cout<<"q.x()"< = 1) // pitch = copysign(M_PI / 2, sinp); // use 90 degrees if out of range // else // pitch = asin(sinp); // cout<<"pitch="< 0) // { // yaw=atan2(-c(2,0),c(0,0)); // } // else if (c(2,0)>0) // { // yaw=atan2(-c(2,0),c(0,0))-M_PI; // } // else // { // yaw=atan2(-c(2,0),c(0,0))+M_PI; // } // yaw=yaw*180/M_PI; // double roll=atan2(-c(1,2),c(1,1))*180/M_PI; // double pitch=atan2(c(1,0),1)*180/M_PI; // cout<<"yaw="< 欢迎分享,转载请注明来源:内存溢出
1 实时订阅GPS平面坐标,并输出距离起点的平面坐标值
赞
(0)
打赏
微信扫一扫
支付宝扫一扫
Educational Codeforces Round 117 (Rated for Div. 2)【A - C】
上一篇
2022-12-15
升级Ubuntu 12.04后ibus输入法图标消失如何处理?
下一篇
2022-12-15
评论列表(0条)