ROS 学习

引言:每当我们开始学习一个新的东西,我们都要给他们搭建好环境

这个是我学习ROS的一个笔记持续更新中

环境:Ubuntu22.04LTS

1.ROS 环境搭建

1.我们这里需要一个Ubuntu的虚拟机,这里我使用的是树莓派5B,这里只需要有一个Ubuntu环境就行,这里我推荐使用小鱼一键安装

bash 复制代码
wget http://fishros.com/install -O fishros && bash fishros

2.这里也可以使用容器技术速度快,而且更轻便

首先看自己有没有桌面版的Docker

在桌面版的Docker里面拉取镜像,并且生成一个容器

检测我们的容器是否生成

在windows终端power shell里面输入

docker stats

出现这个证明容器生成啦

之后的所有演示在容器里面运行

使用vscode安装插件dev containers。container tools docker这三个插件

连接到我们正在运行的容器中

2.安装成功之后

1.设置环境

我们通过在~/.bashrc里面输入这个source /opt/ros/humble/setup.bash

然后在终端上使用ros2命令

输出如下证明我们安装好啦

让我们从这个ros2给出的来进行学习吧

安装必要工具如rqt_graph

bash 复制代码
sudo apt-get install ros-humble-rqt-graph 

安装必要的oh-my-bash这个是个人比较喜欢酷一点的终端,并且安装好用的插件

在终端输入这个安装oh-my-bash

bash 复制代码
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)")"

安装rviz工具

bash 复制代码
sudo apt-get install -y ros-humble-rviz

2.ros action

我们在终端输入

bash 复制代码
ros2 action -h

显示如下

bash 复制代码
root@422001706c93:~# ros2 action -h
usage: ros2 action [-h] Call `ros2 action <command> -h` for more detailed usage. ...

Various action related sub-commands

options:
  -h, --help            show this help message and exit

Commands:
  info       Print information about an action
  list       Output a list of action names
  send_goal  Send an action goal

  Call `ros2 action <command> -h` for more detailed usage.

我们先运行一个节点看看它是什么意思,运行ros2官方给的小乌龟节点

bash 复制代码
ros2 turtlesim turtlesim_node

我们拆分这个终端

1.ros2 action info

一个终端输入

bash 复制代码
ros2 action info -h

我们可以看到这个之后还有

bash 复制代码
root@422001706c93:~# ros2 action info -h
usage: ros2 action info [-h] [-t] [-c] action_name

Print information about an action

positional arguments:
  action_name       Name of the ROS action to get
                    info (e.g. '/fibonacci')

options:
  -h, --help        show this help message and exit
  -t, --show-types  Additionally show the action type
  -c, --count       Only display the number of action
                    clients and action servers

我们运行一下

bash 复制代码
ros2 action info -t turtlesim

看一下它是输出什么

bash 复制代码
root@422001706c93:~# ros2 action info -t turtlesim
Action: turtlesim
Action clients: 0
Action servers: 0
相关推荐
1024小神18 分钟前
SVG标签中path路径参数学习
学习
浅念-33 分钟前
C++入门(2)
开发语言·c++·经验分享·笔记·学习
ZH154558913134 分钟前
Flutter for OpenHarmony Python学习助手实战:面向对象编程实战的实现
python·学习·flutter
简佐义的博客1 小时前
生信入门进阶指南:学习顶级实验室多组学整合方案,构建肾脏细胞空间分子图谱
人工智能·学习
近津薪荼1 小时前
dfs专题4——二叉树的深搜(验证二叉搜索树)
c++·学习·算法·深度优先
rannn_1111 小时前
【苍穹外卖|Day4】套餐页面开发(新增套餐、分页查询、删除套餐、修改套餐、起售停售)
java·spring boot·后端·学习
张人玉2 小时前
VisionPro 定位与卡尺测量学习笔记
笔记·学习·计算机视觉·vsionprp
觉醒大王2 小时前
强女思维:着急,是贪欲外显的相。
java·论文阅读·笔记·深度学习·学习·自然语言处理·学习方法
YCY^v^3 小时前
JeecgBoot 项目运行指南
java·学习
云小逸3 小时前
【nmap源码解析】Nmap OS识别核心模块深度解析:osscan2.cc源码剖析(1)
开发语言·网络·学习·nmap