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

旅游网站开发的背景及意义西安快速建站网络公司

旅游网站开发的背景及意义,西安快速建站网络公司,金华手机模板建站,wordpress 用户权限插件ROS2系列文章目录 ROS2中nav_msgs/msg/Path 数据含义及使用 ROS2中std_msgs/msg/Header 数据含义及使用 ROS中TF变换详解 文章目录 ROS2系列文章目录ROS2中launch编写及参数含义#xff08;xml、python#xff09;一、ROS官方介绍二、实现案例1.编写主函数、CMakeLists.tx…ROS2系列文章目录 ROS2中nav_msgs/msg/Path 数据含义及使用 ROS2中std_msgs/msg/Header 数据含义及使用 ROS中TF变换详解 文章目录 ROS2系列文章目录ROS2中launch编写及参数含义xml、python一、ROS官方介绍二、实现案例1.编写主函数、CMakeLists.txt及package.xml2.编写启动节点的launch文件3.编译并运行 ROS2中launch编写及参数含义xml、python 一、ROS官方介绍 ROS 2中的启动系统负责帮助用户描述其系统的配置然后按描述执行。系统的配置包括运行什么程序在哪里运行传递什么参数以及ROS特定的约定这些约定通过为每个组件提供不同的配置使其易于在整个系统中重用组件。它还负责监测启动过程的状态并报告和/或对这些过程的状态变化作出反应。 ROS2官方说明http://docs.ros.org/en/humble/Tutorials/Intermediate/Launch/Creating-Launch-Files.html#write-the-launch-file 二、实现案例 1.编写主函数、CMakeLists.txt及package.xml 此处创建learn_ros2功能包在learn_ros2/src目录下建立main.cpp该函数具体实现功能参照博文ROS2中nav_msgs/msg/Path 数据含义及使用 #include nav_msgs/msg/path.hpp #include rclcpp/rclcpp.hpp #include string #include unistd.h using namespace std; class My_node:public rclcpp::Node{ public:My_node(std::string node_name):Node(node_name){} }; int main(int argc, char**argv){rclcpp::init(argc,argv);//节点初始化std::shared_ptrMy_node node_ptr std::make_sharedMy_node(test_node);rclcpp::Publishernav_msgs::msg::Path::SharedPtr nav_pub node_ptr-create_publishernav_msgs::msg::Path(/global_path,1);nav_msgs::msg::Path path;geometry_msgs::msg::PoseStamped pose;path.header.frame_id world;while (rclcpp::ok()){path.header.stamp node_ptr-now();path.poses.clear();for (int i 0; i 10; i){pose.header.frame_id world;pose.header.stamp node_ptr-now();pose.pose.position.set__x(i);pose.pose.position.set__y(0.2*i*i2);pose.pose.position.set__z(0);pose.pose.orientation.set__x(0);pose.pose.orientation.set__y(0);pose.pose.orientation.z 0;pose.pose.orientation.w 1;path.poses.push_back(pose);}nav_pub-publish(path);sleep(1);std::cout已发送pathstd::endl;} std::cout退出程序std::endl; }指定功能包learn_ros2的CMakeLists.txt如下 cmake_minimum_required(VERSION 3.8) project(learn_ros2)if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES Clang)add_compile_options(-Wall -Wextra -Wpedantic) endif() # find dependencies find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(rclpy REQUIRED) find_package(std_msgs REQUIRED) find_package(nav_msgs REQUIRED) if(BUILD_TESTING)find_package(ament_lint_auto REQUIRED)# the following line skips the linter which checks for copyrights# comment the line when a copyright and license is added to all source filesset(ament_cmake_copyright_FOUND TRUE)# the following line skips cpplint (only works in a git repo)# comment the line when this package is in a git repo and when# a copyright and license is added to all source filesset(ament_cmake_cpplint_FOUND TRUE)ament_lint_auto_find_test_dependencies() endif() #添加可执行文件名 add_executable(test_node src/main.cpp) #给可执行文件链接ros2的标准库及其他依赖 ament_target_dependencies(test_node rclcpp std_msgs nav_msgs) #将可执行文件安装在指定目录下 install(TARGETS test_node DESTINATION lib/${PROJECT_NAME}) #将launch目录下的文件安装在指定目录下 install(DIRECTORY launchDESTINATION share/${PROJECT_NAME}) ament_package() 2.编写启动节点的launch文件 在learn_ros2目录下建立launch文件夹并在文件目录中新建python及xml文件如下 test_launch.launch.pytest_xml_launch.xml 首先使用python实现test_launch.launch.py文件具体含义参考注释 from launch import LaunchDescription from launch_ros.actions import Nodedef generate_launch_description():parameters_basic1 Node(packagelearn_ros2,executabletest_node,)# 创建LaunchDescription对象launch_description,用于描述launch文件launch_description LaunchDescription([parameters_basic1])# 返回让ROS2根据launch描述执行节点return launch_description该处使用的url网络请求的数据。 使用XML实现test_xml_launch.xml文件具体含义参考注释 launch!-- 启动节点命名为/name1/test_node --node pkglearn_ros2 exectest_node nametest_node namespacename_1/!-- 启动节点命名为/name2/test_node --node pkglearn_ros2 exectest_node nametest_node namespacename_2/!-- 启动节点命名为/name3/test_node,同时将话题/global_path,映射为/test_node3/global_path--node pkglearn_ros2 exectest_node nametest_node namespacename_3remap from/global_path to/test_node3/global_path//node /launch3.编译并运行 注意编写完成launch文件后要使用ros2编译命令对功能包的可执行文件进行生成 使用test_xml_launch.xml启动各个程序 source install/setup.bash ros2 launch learn_ros2 test_xml_launch.xml使用test_launch.launch.py启动各个程序如下
http://www.hkea.cn/news/14335481/

相关文章:

  • 上海高中生做课题的网站做宽屏网站
  • 专业做网站套餐找人做网站内容自己编辑吗
  • 湛江模板建站公司响应式网站特点
  • 深圳网站建设599元全包软件开发培训多少钱
  • 邯郸建设公司网站建筑人才网官网登录
  • 平面设计专业网站网站开发必须要做前端吗
  • 景德镇网站制作公司番禺品牌型网站建设
  • 凡科网站可以做淘宝客吗企业融资方式有哪几种
  • 做网站要用什么服务器吗建筑公司网站md0095设计风格
  • 南阳手机网站制作百度上面做企业网站怎么做
  • 临沂网站建设费用wordpress表单支付
  • 江苏天矗建设集团网站wordpress icp涵数
  • 酒泉网站建设有限公司做时尚网站取个名字
  • 营销网络的建设是什么意思优化百度网站
  • 有趣的网站大全为什么网站开发这么便宜
  • 做网站买什么空间用什么软件来做网站
  • 博客平台 wordpress重庆seo排名软件
  • 网站站内的seo怎么做网站域名被做网站的公司擅自更改
  • php网站开发深圳燃气公司是国企吗
  • 为什么不能自己做网站玩游戏的网页
  • 成都市锦江区网站建设阿里云 网站备案
  • 单页网站模板修改网站建设 尚品中国
  • 北京附近做网站的公司wordpress用户名是哪个文件
  • 微商网站推广WordPress模仿教程
  • 如何网站建设 需要详细的步骤网站按钮代码
  • 个人网站设计怎么做第三方网站做app
  • 建立品牌网站的想做软件开发需要学什么
  • 怎么做公司内部网站代理公司注册上海
  • 金塔精神文明建设网站免费手游代理平台
  • 营销网站建设教程import wordpress