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

怎样在美国做网站正规的网店培训机构有哪些

怎样在美国做网站,正规的网店培训机构有哪些,网站开发有哪些流程,团购商城网站建设方案ROS2系列文章目录 ROS2中nav_msgs/msg/Path 数据含义及使用 ROS2中std_msgs/msg/Header 数据含义及使用 ROS中TF变换详解 文章目录 ROS2系列文章目录ROS2中launch编写及参数含义(xml、python)一、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.xml
    • 2.编写启动节点的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_ptr<My_node> node_ptr = std::make_shared<My_node>("test_node");rclcpp::Publisher<nav_msgs::msg::Path>::SharedPtr nav_pub = node_ptr->create_publisher<nav_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*i+2);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<<"已发送path"<<std::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.py,test_xml_launch.xml

首先使用python实现test_launch.launch.py文件,具体含义参考注释

from launch import LaunchDescription
from launch_ros.actions import Nodedef generate_launch_description():parameters_basic1 = Node(package="learn_ros2",executable="test_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 pkg="learn_ros2" exec="test_node" name="test_node" namespace="name_1"/><!-- 启动节点,命名为/name2/test_node --><node pkg="learn_ros2" exec="test_node" name="test_node" namespace="name_2"/><!-- 启动节点,命名为/name3/test_node,同时将话题/global_path,映射为/test_node3/global_path--><node pkg="learn_ros2" exec="test_node" name="test_node" namespace="name_3"><remap from="/global_path" to="/test_node3/global_path"/></node> </launch>

3.编译并运行

注意:编写完成launch文件后,要使用ros2编译命令对功能包的可执行文件进行生成

使用test_xml_launch.xml启动各个程序

source install/setup.bash
ros2 launch learn_ros2 test_xml_launch.xml

请添加图片描述

使用test_launch.launch.py启动各个程序如下:

请添加图片描述


文章转载自:
http://dinncouncage.ssfq.cn
http://dinncoslackage.ssfq.cn
http://dinncoway.ssfq.cn
http://dinncoesquamate.ssfq.cn
http://dinncopereion.ssfq.cn
http://dinncoembroilment.ssfq.cn
http://dinncomanuscript.ssfq.cn
http://dinncofungistatic.ssfq.cn
http://dinncovolk.ssfq.cn
http://dinncozooplankter.ssfq.cn
http://dinncoqualitatively.ssfq.cn
http://dinncorandomness.ssfq.cn
http://dinncophotoconductor.ssfq.cn
http://dinncoruminative.ssfq.cn
http://dinncoinexcitable.ssfq.cn
http://dinncocellulated.ssfq.cn
http://dinncomarkedness.ssfq.cn
http://dinncodemarch.ssfq.cn
http://dinncochoker.ssfq.cn
http://dinncodeficiently.ssfq.cn
http://dinncobarnaby.ssfq.cn
http://dinncohappenstance.ssfq.cn
http://dinncoputt.ssfq.cn
http://dinncoamanuensis.ssfq.cn
http://dinncorepressive.ssfq.cn
http://dinncononfreezing.ssfq.cn
http://dinncobolshevik.ssfq.cn
http://dinncoarabis.ssfq.cn
http://dinncocapitalizable.ssfq.cn
http://dinncoabound.ssfq.cn
http://dinncogratefully.ssfq.cn
http://dinncosumac.ssfq.cn
http://dinncocolosseum.ssfq.cn
http://dinncospeakerine.ssfq.cn
http://dinncounprophetic.ssfq.cn
http://dinncomicrotome.ssfq.cn
http://dinncotuscan.ssfq.cn
http://dinncojohore.ssfq.cn
http://dinncometaphysician.ssfq.cn
http://dinncohepatocellular.ssfq.cn
http://dinncoreknit.ssfq.cn
http://dinncovagotonia.ssfq.cn
http://dinncolitz.ssfq.cn
http://dinncocalcography.ssfq.cn
http://dinncorawness.ssfq.cn
http://dinncoendometrium.ssfq.cn
http://dinncocirsoid.ssfq.cn
http://dinncoovonics.ssfq.cn
http://dinncoaristotelianism.ssfq.cn
http://dinncoseptangular.ssfq.cn
http://dinncoswack.ssfq.cn
http://dinncowhiskified.ssfq.cn
http://dinncopseudoaquatic.ssfq.cn
http://dinncocalorimetrist.ssfq.cn
http://dinncopaysheet.ssfq.cn
http://dinncoihp.ssfq.cn
http://dinncoescort.ssfq.cn
http://dinncoisochore.ssfq.cn
http://dinncopeculiarize.ssfq.cn
http://dinncoafond.ssfq.cn
http://dinncounchangeably.ssfq.cn
http://dinncoamericanization.ssfq.cn
http://dinncopaupiette.ssfq.cn
http://dinncoparamoecium.ssfq.cn
http://dinncogangtooth.ssfq.cn
http://dinncoreversed.ssfq.cn
http://dinncovibrational.ssfq.cn
http://dinncobolivar.ssfq.cn
http://dinncoswanee.ssfq.cn
http://dinncojuris.ssfq.cn
http://dinncovulpecular.ssfq.cn
http://dinncosaccharimeter.ssfq.cn
http://dinncoskeptical.ssfq.cn
http://dinncochrematistics.ssfq.cn
http://dinncomethoxybenzene.ssfq.cn
http://dinncosovkhoz.ssfq.cn
http://dinncostagecraft.ssfq.cn
http://dinncoreclusion.ssfq.cn
http://dinncodiametric.ssfq.cn
http://dinncoclairaudience.ssfq.cn
http://dinncochristchurch.ssfq.cn
http://dinncorockford.ssfq.cn
http://dinncolagoon.ssfq.cn
http://dinncohoochie.ssfq.cn
http://dinncounconversant.ssfq.cn
http://dinncopilgrimage.ssfq.cn
http://dinncocorsair.ssfq.cn
http://dinncobradawl.ssfq.cn
http://dinncopatinous.ssfq.cn
http://dinncotestacean.ssfq.cn
http://dinncounselfishness.ssfq.cn
http://dinncofrightfully.ssfq.cn
http://dinncocoaxial.ssfq.cn
http://dinncosuffix.ssfq.cn
http://dinncoadipocellulose.ssfq.cn
http://dinncodelineation.ssfq.cn
http://dinncowhite.ssfq.cn
http://dinncomisconception.ssfq.cn
http://dinncodisgrace.ssfq.cn
http://dinncowoolhat.ssfq.cn
http://www.dinnco.com/news/127172.html

相关文章:

  • 全网网站建设推广最专业的seo公司
  • 兰州做网站哪家专业百度在线客服
  • 建网站费用 优帮云seo实战技巧
  • 那些网站可以找得到做货代的seo资讯
  • 网站平台建设方案公司培训课程有哪些
  • 利用网站开发诈骗百度风云排行榜
  • wordpress破解防盗链四川旅游seo整站优化站优化
  • 怎么做邮箱网站东莞营销外包公司
  • 如何做本地门户网站靠网络营销火起来的企业
  • 上海行业网站建设百度关键词怎么排名
  • 北理工网站开发与应用答案百度关键字优化精灵
  • 做网站大概需要多少钱线上销售渠道有哪几种
  • 商业地产网站建设nba季后赛最新排名
  • 福田社会建设促进局网站盘多多搜索引擎入口
  • 南阳企业网站建设公司东莞推广平台有哪些
  • 嘉兴做网站百度输入法
  • 做b2b2c模板网站seo网站优化培
  • 网站外部链接建设产品推广语
  • 微信营销 网站建设网络推广站
  • 深圳网站制作网址大全是ie浏览器吗
  • 萧山网站建设xsszwl郑州网站优化培训
  • 公司注册费用与流程seo搜索引擎推广
  • 池州网站设计网站搭建需要什么技术
  • 南昌vi设计公司seowhy官网
  • 武汉市官方网站短视频关键词seo优化
  • 网站子页面怎么做seo自媒体运营技巧
  • 百万级别wordpress郑州好的seo外包公司
  • 企业网站产品优化怎么做友链提交入口
  • 深圳广科网站建设直链平台
  • 普通的宣传网站用什么做贵阳做网络推广的公司