木叶飞舞之【机器人ROS2】篇章_第二节、turtlebot3安装

news/2025/2/22 10:55:14

没有真实小车的情况下,利用gazebo的仿真,操作小乌龟来学习ros2。废话不多说,直接上命令。

Install Gazebo

sudo apt install ros-humble-gazebo-*

Install Cartographer

假如前一节未安装源码版本的cartographer,那就安装apt版本的。

sudo apt install ros-humble-cartographer
sudo apt install ros-humble-cartographer-ros

Install Navigation2

sudo apt install ros-humble-navigation2
sudo apt install ros-humble-nav2-bringup

Install TurBot3 Packages

source ~/.bashrc
sudo apt install ros-humble-dynamixel-sdk
sudo apt install ros-humble-turtlebot3-msgs
sudo apt install ros-humble-turtlebot3
sudo apt install ros-humble-turtlebot3-gazebo

Install Teleop

sudo apt-get install ros-humble-teleop-twist-keyboard

打开终端,启动机器人gazebo

ros2 launch turtlebot3_gazebo turtlebot3_house.launch.py

另开终端,再启动cartographer启动节点

ros2 launch turtlebot3_cartographer cartographer.launch.py 

另开终端,启动键盘启动节点,控制机器人

ros2 run teleop_twist_keyboard teleop_twist_keyboard

另开终端,结束构图,停止接受新数据

ros2 service call /finish_trajectory cartographer_ros_msgs/srv/FinishTrajectory "{trajectory_id: 0}"

序列化保存其当前状态

ros2 service call /write_state cartographer_ros_msgs/srv/WriteState "{filename: '/home/develop/bags/mymap.pbstream'}"

将pbstream转化为pgm和yaml,在cartographer_pbstream_to_ros_map目录下执行

cd /opt/ros/humble/lib/cartographer_ros
./cartographer_pbstream_to_ros_map -map_filestem=${HOME}/bags/mymap -pbstream_filename=${HOME}/bags/mymap.pbstream -resolution=0.05

http://www.niftyadmin.cn/n/4963270.html

相关文章

OpenCV之reshape函数

函数原型: /** brief Changes the shape and/or the number of channels of a 2D matrix without copying the data.The method makes a new matrix header for \*this elements. The new matrix may have a different sizeand/or different number of channels. A…

Windows10批处理命令行设置环境变量笔记,无需重新安装python与chrome

近期,工作中经常安装、部署python生产、开发环境,比较麻烦,也没有心情去优化。突然,我的电脑崩溃了,在重新安装电脑的过程中,保留了原来的安装软件(有的没有放在系统盘中)&#xff0…

SSM框架的学习与应用(Spring + Spring MVC + MyBatis)-Java EE企业级应用开发学习记录(第三天)动态SQL

动态SQL—SSM框架的学习与应用(Spring Spring MVC MyBatis)-Java EE企业级应用开发学习记录(第三天)Mybatis的动态SQL操作 昨天我们深入学习了Mybatis的核心对象SqlSessionFactoryBuilder,掌握MyBatis核心配置文件以及元素的使用,也掌握My…

微服务中间件--统一网关Gateway

统一网关Gateway 8.统一网关Gatewaya.搭建网关服务b.路由断言工厂c.路由过滤器GatewayFilterd.全局过滤器GlobalFiltere.过滤器的执行顺序f.网关的cors跨域配置 8.统一网关Gateway 网关功能: 身份认证和权限校验服务路由、负载均衡请求限流 网关的技术实现 在Spr…

VMware和ubuntu配置Hadoop环境

目录 一、获取VMware安装包 1、官网获取 1)首先先进入官网,官网首页是下面这样: 2)接着点击产品选项 3)进入后点击查看所有产品,然后在右上角选择排序方式为Z到A,然后向下滑动找到Workstation…

ahooks.js:一款强大的React Hooks库及其API使用教程(六)

一、ahooks.js简介二、ahooks.js安装三、继续ahooks.js API的介绍与使用教程71. useIsomorphicLayoutEffect72. useLatest73. useMemoizedFn74. useReactive75. useTrackedEffect 一、ahooks.js简介 ahooks是一款由阿里巴巴开发团队设计的React Hooks库,提供了一系…

Linux服务——http协议及nginx服务

目录 一、HTTP协议 1、跨网络的主机间通讯方式 套接字相关的系统调用 2、HTTP协议访问网站的过程 3、http协议状态码分类 常见的http协议状态码 4、MIME 5、URL组成 6、HTTP协议版本 7、系统处理http请求的工作模式 8、apache与nginx的区别 二、I/O模型 I/O模型相关…

pymysql的使用

pymysql的使用 1 驱动 MySQL基于TCP协议之上开发,但是网络连接后,传输的数据必须遵循MySQL的协议。 封装好MySQL协议的包,就是驱动程序。 MySQL的驱动: MySQLdb: 最有名的库。对MySQL的C Client封装实现,支持Python…