Apollo-ROS1*

背景介绍

在这里插入图片描述

各种模块是如何交互数据的——ROS功能框架

在这里插入图片描述

使用ROS框架,方便快速验证顶层的一些算法和技术方案是否可行。

为什么用框架
希望可以将更多的经历放在算法的迭代上,而不用关注太多底层的实现

为什么是ROS
ROS是一个比较强大且灵活的机器人编程框架;
从软件方面来说:是基于消息传递的分布式多进程框架;
很多著名的机器人开源框架都是基于ROS的

ROS概述

在这里插入图片描述

  1. 基本概念
  2. 稍微深入一点的框架
  3. 机器人通用的描述语言(比如TF)
  4. Service/Time/Bag
  5. 实践

基本概念

特征:
  • 通信时点对点
  • 支持分布式
  • 跨语言(并不关注每个节点用什么语言,只要用了ROS提供的接口就行)
  • 轻量级(只需要关注自己的算法逻辑,不需要关注底层的算法通信)
  • 开源的
术语:

Master:管理节点之间的逻辑关系

  1. 节点:一个个算法集合,相互之间独立,但需要相互通信。
  2. 作用:节点之间的相互发现、相互建立连接、相互交换数据

在这里插入图片描述
两个节点:perception(感知模块)、planning
交互:感知模块将感知到的障碍物结果发给规划模块
连接建立过程:
当节点启动时,会在ROScore(Master)中进行注册,比如planning,注册后,planning会向ROScore订阅障碍物信息。当感知模块注册时,会告诉ROScore它可以提供障碍物信息,ROScore发现两者可以相匹配,就会告诉planning,你订阅的信息可以从感知模块拿,那么planning就会向感知模块申请连接,并建立数据通路。至此,ROScore的功能就算完成了。
topic:话题,数格式为MSG(MSG像是一个结构体,可以包含各种类型的数据)
在这里插入图片描述

/:全局变量

对planning的调试(不一定真的写一个完成的perception C++代码程序):
Rostopic pub(ROS提供的一个命令行工具)
加上topic的名字Obstacle以及对应的Type,再加上MSG里的数据,可以模拟感知发送Obstacle信息给planning。

MSG
在这里插入图片描述

ROSlaunch:把所有节点启动的行为放到一个描述文件里。(用来批量启动节点程序)
启动时,会先检测有无ROScore

  • 有,直接启动节点
  • 无,先启动ROScore,再启动节点

Talker:发送数据的一方(提供Topic/Service,如感知节点)

Listener:接收数据的一方

在这里插入图片描述

ROS原理1

共享内存通信:减少数据的复制次数,提高通信效率。
(比如camera模块需要将数据提供给很多节点,一对多)
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
In file included from /home/acceler/code/apollo_ros/apollo_ros/src/apollo.ros-1.0.0-master/apollo_common/include/apollo_common/apollo_app.h:46:0, from /home/acceler/code/apollo_ros/apollo_ros/src/apollo.ros-1.0.0-master/apollo_common/src/apollo_app.cc:33: /home/acceler/code/apollo_ros/apollo_ros/src/apollo.ros-1.0.0-master/apollo_common/include/apollo_common/log.h:40:10: fatal error: glog/logging.h: No such file or directory #include <glog/logging.h> ^~~~~~~~~~~~~~~~ compilation terminated. apollo.ros-1.0.0-master/apollo_common/CMakeFiles/apollo_common.dir/build.make:62: recipe for target 'apollo.ros-1.0.0-master/apollo_common/CMakeFiles/apollo_common.dir/src/apollo_app.cc.o' failed make[2]: *** [apollo.ros-1.0.0-master/apollo_common/CMakeFiles/apollo_common.dir/src/apollo_app.cc.o] Error 1 make[2]: *** Waiting for unfinished jobs.... In file included from /home/acceler/code/apollo_ros/apollo_ros/src/apollo.ros-1.0.0-master/apollo_common/include/apollo_common/adapters/adapter_manager.h:48:0, from /home/acceler/code/apollo_ros/apollo_ros/src/apollo.ros-1.0.0-master/apollo_common/src/adapters/adapter_manager.cc:33: /home/acceler/code/apollo_ros/apollo_ros/src/apollo.ros-1.0.0-master/apollo_common/include/apollo_common/adapters/adapter.h:49:10: fatal error: glog/logging.h: No such file or directory #include <glog/logging.h> ^~~~~~~~~~~~~~~~ compilation terminated. apollo.ros-1.0.0-master/apollo_common/CMakeFiles/apollo_common.dir/build.make:110: recipe for target 'apollo.ros-1.0.0-master/apollo_common/CMakeFiles/apollo_common.dir/src/adapters/adapter_manager.cc.o' failed make[2]: *** [apollo.ros-1.0.0-master/apollo_common/CMakeFiles/apollo_common.dir/src/adapters/adapter_manager.cc.o] Error 1 CMakeFiles/Makefile2:3894: recipe for target 'apollo.ros-1.0.0-master/apollo_common/CMakeFiles/apollo_common.dir/all' failed make[1]: *** [apollo.ros-1.0.0-master/apollo_common/CMakeFiles/apollo_common.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 54%] Linking CXX executable /home/acceler/code/apollo_ros/apollo_ros/devel/lib/IntegratedNavigation/IntegratedNavigation_node [ 54%] Built target IntegratedNavigation_node [ 55%] Linking CXX executable /home/acceler/code/apollo_ros/apollo_ros/devel/lib/TimeSynchronierProcess/timeSynchronierProcess_node [ 55%] Built target timeSynchronierProcess_node Makefile:140: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed
07-23

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值