ROS2测试仿真

电脑配置:R7-7840H 核显

结论:turtlebot3 运行失败。

turtlebot4 可以进入仿真环境,但是无法操作。

现在在用 ign gazebo 驱动简单的差分机器人

ign gazebo

采用ign gazebo 打开简单的差分机器人

安装

javascript 复制代码
sudo apt-get install ros-${ROS_DISTRO}-ros-gz
sudo apt install ros-humble-gazebo-ros-pkgs 

# 桥接器 用于 ros2与gazebo Transport 之间交换信息
sudo apt-get install ros-humble-ros-ign-bridge

# 接受键盘信息并转为 twist
sudo apt-get install ros-humble-teleop-twist-keyboard

运行

javascript 复制代码
# 运行仿真
ign gazebo -v 4 -r visualize_lidar.sdf

# 查看话题
ign topic -l

# 为/model/vehicle_blue/cmd_vel 创建桥接器
ros2 run ros_gz_bridge parameter_bridge /model/vehicle_blue/cmd_vel@geometry_msgs/msg/Twist]ignition.msgs.Twist

# 键盘控制节点
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/model/vehicle_blue/cmd_vel

# lidar创建桥接器
ros2 run ros_gz_bridge parameter_bridge /lidar2@sensor_msgs/msg/LaserScan[ignition.msgs.LaserScan --ros-args -r /lidar2:=/laser_scan

turtlebot

安装

参考链接:https://turtlebot.github.io/turtlebot4-user-manual/software/turtlebot4_robot.html

git clone 慢

添加

https://ghfast.top/

javascript 复制代码
git clone https://github.com/turtlebot/turtlebot4_robot.git  -b humble
git clone https://ghfast.top/https://github.com/turtlebot/turtlebot4_robot.git  -b humble

turtlebot3

javascript 复制代码
gazebo 启动问题
export SVGA_VGPU10=0

export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:/home/ly/.gazebo/models

# 设置TurtleBot3模型
export TURTLEBOT3_MODEL=burger

# 启动TurtleBot3 World环境
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

turtlebot4

javascript 复制代码
gazebo 启动问题
export SVGA_VGPU10=0

# 仿真launch
ros2 launch turtlebot4_ignition_bringup turtlebot4_ignition.launch.py 

# 键盘控制节点
ros2 run teleop_twist_keyboard teleop_twist_keyboard

虚拟机打不开共享文件夹

javascript 复制代码
sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
相关推荐
欧阳天羲14 小时前
PyTorch 入门:搭建机器人目标检测模型(识别障碍物 )
pytorch·目标检测·机器人
初学大模型14 小时前
我们从神经网络进化过程的角度从新审视神经网络
人工智能·机器人
GitCode官方18 小时前
具身智能时代,从“白虎”开始:白虎数据集构建通用机器人数据底座
机器人·具身智能·atomgit
脑极体1 天前
机器人的罪与罚
人工智能·机器人
点云SLAM1 天前
凸优化(Convex Optimization)理论(1)
人工智能·算法·slam·数学原理·凸优化·数值优化理论·机器人应用
Evand J1 天前
【课题推荐】基于群体智能的定位系统优化——多机器人协同定位,通过群体智能优化路径规划与误差修正
机器人·协同·路径·多机器人
liiiuzy1 天前
基于move_base的机器狗定位与导航
ros
ee_trade1 天前
EE TRADE易投合约网格机器人创建全指南
人工智能·机器人·区块链
视***间1 天前
视程空间 发布高性能机器人边缘 AI 平台 ARC6N0 T5X,搭载 NVIDIA Jetson Thor
人工智能·机器人·边缘计算·视程空间·ai算力开发板
深蓝学院1 天前
完全端到端闭环导航!仅需相机,LoGoPlanner实现感知定位规划一体化
机器人·导航·端到端·具身智能