ROS2基础 | topic 实战 一


1 专栏介绍

  本专栏为ROS2的从零基础到应用于落地项目的实用教程,附C++工程级全套代码。
  详情:ROS | 实战教程源码:gorilla_ros_tutorials


2 communication包

  基于通用框架包构建出communication包

cd gorilla_ros_tutorials/src
cp general_framework communication -rf

  修改package.xml和CMakeLists.txt文件

// package.xml
<name>communication</name>
<version>0.0.0</version>
<description>TODO: This is a communication tutorials for ROS2.</description>
<maintainer email="gorilla_robot@126.com">gorilla</maintainer>

// CMakeLists.txt
project(communication)

add_executable(communication src/node_main.cc)
ament_target_dependencies(communication ${dependencies})

install(TARGETS 
  communication
  DESTINATION lib/${PROJECT_NAME})

  做个基础编译和运行。

cd ../    // 回到gorilla_ros_tutorials目录下

./compiling.sh clear
./compiling.sh make

source install/setup.bash
./install/communication/lib/communication/communication

  communication包搞定。
  再新增目录tutorials以及其下的topic、service、action、parameter目录,会将通信教程内容放在如下的层级目录中。特此说明

└── src
    ├── communication
    │   ├── CMakeLists.txt
    │   ├── include
    │   │   └── general_framework
    │   ├── package.xml
    │   ├── src
    │   │   └── node_main.cc
    │   └── tutorials
    │       ├── action
    │       ├── parameter
    │       ├── service
    │       └── 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值