当前位置: 首页 > news >正文

网站开发地图导航页面广州公司网站建设公司

网站开发地图导航页面,广州公司网站建设公司,网站建设 汇卓,哪个建立网站好文章目录 操作流程节点代码 操作流程 1、让nodeHandle发布 /cmd_vel话题#xff1b; 2、设定一个目标朝向角#xff0c;当姿态信息中的朝向角和目标朝向角不一致时#xff0c;控制机器人转向目标朝向角。 节点代码 /***************************************************… 文章目录 操作流程节点代码 操作流程 1、让nodeHandle发布 /cmd_vel话题 2、设定一个目标朝向角当姿态信息中的朝向角和目标朝向角不一致时控制机器人转向目标朝向角。 节点代码 /********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2017-2020, Waterplus http://www.6-robot.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the WaterPlus nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * FOOTPRINTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *********************************************************************/ /*!******************************************************************author ZhangWanjie********************************************************************/#include ros/ros.h #include sensor_msgs/Imu.h #include tf/tf.h #include geometry_msgs/Twist.h// 速度消息发布对象全局变量 ros::Publisher vel_pub;// IMU 回调函数 void IMUCallback(const sensor_msgs::Imu msg) {// 检测消息包中四元数数据是否存在if(msg.orientation_covariance[0] 0)return;// 四元数转成欧拉角tf::Quaternion quaternion(msg.orientation.x,msg.orientation.y,msg.orientation.z,msg.orientation.w);double roll, pitch, yaw;tf::Matrix3x3(quaternion).getRPY(roll, pitch, yaw);// 弧度换算成角度roll roll*180/M_PI;pitch pitch*180/M_PI;yaw yaw*180/M_PI;ROS_INFO(滚转 %.0f 俯仰 %.0f 朝向 %.0f, roll, pitch, yaw);// 速度消息包geometry_msgs::Twist vel_cmd;// 目标朝向角double target_yaw 90;// 计算速度double diff_angle target_yaw - yaw;vel_cmd.angular.z diff_angle * 0.01;vel_cmd.linear.x 0.1;vel_pub.publish(vel_cmd); }int main(int argc, char **argv) {setlocale(LC_ALL, );ros::init(argc,argv, demo_imu_behavior); ros::NodeHandle n;// 订阅 IMU 的数据话题ros::Subscriber sub n.subscribe(imu/data, 100, IMUCallback);// 发布速度控制话题vel_pub n.advertisegeometry_msgs::Twist(/cmd_vel,10);ros::spin();return 0; }
http://www.zqtcl.cn/news/984930/

相关文章:

  • 游戏网站建设免费版百度只更新快照不收录网站
  • html小清新类型网站网站建设中应注意哪些问题
  • 网站开发技术和seo的联系精品课程网站建设 公司
  • 大型网站建设一般多少钱wordpress 调用百度前端公众库
  • 个人电脑做网站服务器网站地方网站域名用全拼
  • 我们网站在那里登陆后台系统管理成都app制作开发
  • 可以做问卷调查的网站仙居网站建设
  • 知名网站建设公司电话做一个小程序需要多少钱
  • 外贸找客户有什么网站个人如何做网站
  • 旅游项目网站开发ui界面设计分析
  • 企业建设网站没有服务器代理网页浏览
  • 深圳网站建设新闻网站建设营销的企业
  • 建筑设计网站软件排名工具
  • wordpress theme珠宝最适合seo的网站源码
  • 建设工程规划许可证查询网站畜牧业网站模板
  • 做网站大概要多少钱页面网站缓存如何做
  • 家电网站建设需求分析朔州网络推广
  • 陕西交通建设集团网站体检网络营销中自建网站
  • 做游戏的php网站有哪些微信商城是什么
  • wordpress memcached redux深圳网站优化方法
  • 移动商城 网站建设方法方式韩国导航地图app
  • 企业网站源码是什么瑞安企业做网站
  • 佛山深圳建网站wordpress 段代码
  • 网站备案 强制仿牌网站容易被攻击吗
  • 网站做访问追踪js特效演示网站
  • 建设网站女装名字大全宝宝投票网站怎么做
  • 江苏省建设厅网站首页天津百度网站排名优化
  • 织梦网络设计工作室网站模板镇江市精神文明建设网站
  • 网站管理工具装修公司设计软件有哪些
  • 招标网站的服务费怎么做分录什么网站做玩具的比较多