多個機器人同時加載在rviz及gazebo同一個場景中

1. 配置launch文件

gazebo的加載相對容易,但rviz中加載,需要構建完整的tf樹(world → map(或map_merged)→ odom → base_footprint → base_link → base_scan)才能正常顯示,launch文件主要是在構建tf樹。

<launch><arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/><arg name="first_tb3"  default="tb3_0"/><arg name="second_tb3" default="tb3_1"/><arg name="third_tb3"  default="tb3_2"/><arg name="first_tb3_x_pos" default="-7.0"/><arg name="first_tb3_y_pos" default="-1.0"/><arg name="first_tb3_z_pos" default=" 0.0"/><arg name="first_tb3_yaw"   default=" 1.57"/><arg name="second_tb3_x_pos" default=" 7.0"/><arg name="second_tb3_y_pos" default="-1.0"/><arg name="second_tb3_z_pos" default=" 0.0"/><arg name="second_tb3_yaw"   default=" 1.57"/><arg name="third_tb3_x_pos" default=" 0.5"/><arg name="third_tb3_y_pos" default=" 3.0"/><arg name="third_tb3_z_pos" default=" 0.0"/><arg name="third_tb3_yaw"   default=" 0.0"/><include file="$(find gazebo_ros)/launch/empty_world.launch"><arg name="world_name" value="$(find turtlebot3_gazebo)/worlds/turtlebot3_house.world"/><arg name="paused" value="false"/><arg name="use_sim_time" value="true"/><arg name="gui" value="true"/><arg name="headless" value="false"/><arg name="debug" value="false"/></include>  <group ns = "$(arg first_tb3)"><arg name="robot_name" default="$(arg first_tb3)"/><arg name="tf_prefix" value="$(arg robot_name)"/><param name="robot_description" command="$(find xacro)/xacro $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro  tf_prefix:=$(arg robot_name)" /><node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen"><param name="publish_frequency" type="double" value="50.0" /><param name="tf_prefix" value="$(arg first_tb3)" /></node><node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model $(arg first_tb3) -x $(arg first_tb3_x_pos) -y $(arg first_tb3_y_pos) -z $(arg first_tb3_z_pos) -Y $(arg first_tb3_yaw) -param robot_description" /><!-- TF 變換:從融合地圖到機器人局部地圖 --><node pkg="tf" type="static_transform_publisher" name="map_merged_to_robot1_map"args="$0 0 0 0 0 0 map_merged $(arg tf_prefix)/map 100" />  <node pkg="tf" type="static_transform_publisher" name="robot1_map_to_robot1_odom"args="$0 0 0 0 0 0 $(arg tf_prefix)/map $(arg tf_prefix)/odom 100" />  </group><group ns = "$(arg second_tb3)"><arg name="robot_name" default="$(arg second_tb3)"/><arg name="tf_prefix" value="$(arg robot_name)"/><param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro  tf_prefix:=$(arg robot_name)" /><node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen"><param name="publish_frequency" type="double" value="50.0" /><param name="tf_prefix" value="$(arg second_tb3)" /></node><node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model $(arg second_tb3) -x $(arg second_tb3_x_pos) -y $(arg second_tb3_y_pos) -z $(arg second_tb3_z_pos) -Y $(arg second_tb3_yaw) -param robot_description" /><!-- TF 變換:從融合地圖到機器人局部地圖 --><node pkg="tf" type="static_transform_publisher" name="map_merged_to_robot2_map"args="$0 0 0 0 0 0 map_merged $(arg tf_prefix)/map 100" />  <node pkg="tf" type="static_transform_publisher" name="robot2_map_to_robot2_odom"args="$0 0 0 0 0 0 $(arg tf_prefix)/map $(arg tf_prefix)/odom 100" />  </group><group ns = "$(arg third_tb3)"><arg name="robot_name" default="$(arg third_tb3)"/><arg name="tf_prefix" value="$(arg robot_name)"/><param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro  tf_prefix:=$(arg robot_name)" /><node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen"><param name="publish_frequency" type="double" value="50.0" /><param name="tf_prefix" value="$(arg third_tb3)" /></node><node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model $(arg third_tb3) -x $(arg third_tb3_x_pos) -y $(arg third_tb3_y_pos) -z $(arg third_tb3_z_pos) -Y $(arg third_tb3_yaw) -param robot_description" /><!-- TF 變換:從融合地圖到機器人局部地圖 --><node pkg="tf" type="static_transform_publisher" name="map_merged_to_robot3_map"args="$0 0 0 0 0 0 map_merged $(arg tf_prefix)/map 100" />  <node pkg="tf" type="static_transform_publisher" name="robot3_map_to_robot3_odom"args="$0 0 0 0 0 0 $(arg tf_prefix)/map $(arg tf_prefix)/odom 100" />  </group><node pkg="tf" type="static_transform_publisher" name="world_to_map_merged"  args="0 0 0 0 0 0 world map_merged 100" /><!-- 啟動RViz --><node pkg="rviz" type="rviz" name="rviz" required="true" args="-d $(find multi_robot)/config/multi_robot.rviz"/> </launch>

2. 修改urdf模型

nano ~/catkin_ws/src/turtlebot3/turtlebot3_description/urdf/turtlebot3_waffle_pi.gazebo.xacro

為各機器人增加tb3/odom->tb3/base_footprint的tf映射,防止odom->base_footprint全局tf映射。

  <gazebo><plugin name="turtlebot3_waffle_pi_controller" filename="libgazebo_ros_diff_drive.so"><commandTopic>cmd_vel</commandTopic><odometryTopic>$(arg tf_prefix)/odom</odometryTopic><odometryFrame>$(arg tf_prefix)/odom</odometryFrame><odometrySource>world</odometrySource><publishOdomTF>true</publishOdomTF><robotBaseFrame>$(arg tf_prefix)/base_footprint</robotBaseFrame><publishWheelTF>false</publishWheelTF><publishTf>true</publishTf><publishWheelJointState>true</publishWheelJointState><legacyMode>false</legacyMode><updateRate>30</updateRate><leftJoint>wheel_left_joint</leftJoint><rightJoint>wheel_right_joint</rightJoint><wheelSeparation>0.287</wheelSeparation><wheelDiameter>0.066</wheelDiameter><wheelAcceleration>1</wheelAcceleration><wheelTorque>10</wheelTorque><rosDebugLevel>na</rosDebugLevel></plugin></gazebo>

3. 執行

roslaunch turtlebot3_gazebo multi_turtlebot3_rviz.launch

在這里插入圖片描述

在這里插入圖片描述

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/84844.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/84844.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/84844.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Text2SQL、Text2API基礎

你有一個能力超強但“不太懂行”的助手&#xff08;大語言模型LLM&#xff09;。它能說會道&#xff0c;知識淵博&#xff0c;但它&#xff1a; 不懂你的數據庫&#xff1a; 不知道你的數據庫里有哪些表&#xff0c;表里有哪些字段&#xff0c;這些字段代表什么意思。不懂你的…

JDK 8u231安裝教程 - Windows 64位下載安裝及環境變量配置指南

下載安裝包 把jdk-8u231-windows-x64.exe這個文件下載下來&#xff0c;下載鏈接&#xff1a;https://pan.quark.cn/s/a610ca7e5e9d&#xff0c;隨便放哪兒&#xff0c;比如桌面或者下載文件夾。 雙擊運行安裝 找到下載好的那個exe文件&#xff0c;直接雙擊打開。可能會彈個窗口…

LatentSync V8版 - 音頻驅動視頻生成數字人說話視頻 更新V1.6版模型 支持50系顯卡 支持批量 一鍵整合包下載

LatentSync 是字節跳動開源的一款"AI口型同步神器"&#xff0c;簡單來說就是能讓視頻里的人物嘴巴動得和聲音完美匹配的工具。比如你給一段配音&#xff0c;它能自動調整視頻人物的嘴型&#xff0c;按照配音里的聲音說出來&#xff0c;就像真人說話一樣自然。簡單說就…

從一組線段中得出四邊形的算法

原始的需求是使用OpenCV的直線檢測算法&#xff08;例如LSD&#xff09;之后&#xff0c;得到一組線段。然后需要從這些線段得到類似矩形的四邊形&#xff0c;用于檢測經過透視變換的矩形物體。這些線段不一定首尾相接&#xff0c;彼此之間可能相交或有一定距離。 以下是需求圖…

提示詞Prompts(2)

摘要&#xff1a; 本文介紹了langchain.prompts中基礎的提示詞模板的高級用法&#xff0c;包括利用PipelinePrompt組合Prompt使用&#xff0c;多模態場景、動態占位符的使用等進行了介紹。 文章目錄 1. 背景2. PipelinePrompt2.1 組合兩個Prompt模板2.2 多模態模板 3. 聊天提示…

服務器代碼知識點補充

目錄 UdpServer: 觀察者模式: remove_if算法 管道補充: 文件的標準輸出 ,標準輸入,標準錯誤 UdpServer: 數據接收模塊關心Adduser 和Deleuser 兩個模塊 線程池關心Route模塊 將這三個方法注冊進服務器 ,但是有臨界區問題(線程池與數據接受模塊可能同時訪問用戶管理模塊,所…

R語言緩釋制劑QBD解決方案之二

藥物層優化研究 在藥物層工藝中水溶劑蒸發起到重要的作用。濕的環境會使丸子聚集&#xff0c;而干的環境影響藥物與MCC的粘合。輸入變量如氣流量&#xff0c;噴霧速率&#xff0c;霧化壓力&#xff0c;和產品溫度對MCC沉著和包衣溶劑蒸發的平衡有影響。進行了帶3個中心點的24-…

Html實現圖片上傳/裁剪/馬賽克/壓縮/旋轉/縮放

cropper下載 https://download.csdn.net/download/dongyan3595/90970115 前端代碼 <!doctype html> <html lang"en"> <head><base href"/aishop/"><meta name"viewport" content"widthdevice-width, initial…

springboot項目中整合高德地圖

一&#xff1a;高德開放平臺的使用 高德開放平臺 | 高德地圖API 注冊高德地圖賬號 認證填寫個人信息&#xff1a; 認證方式選擇“個人認證開發者”即可&#xff0c;然后完善信息 認證成功之后&#xff0c;再次進入控制臺&#xff0c;創建關于地圖的應用 創建Key&#xff08;y…

鴻蒙開發-視頻學習及實用中的一些小結

1.extend 和 styles extend是在styles基礎上進行了升級 使用的時候extend是全局的。 styles不加function 局部 加了就是全局。 2.builder 中要引用comp組件 需要在外層嵌套布局 3.ability之間的跳轉 want需要加&#xff1b; 4. as 類型斷言 &#xff01;跟在xxx! 表示…

網盤直鏈解析網頁版

不支持百度網盤、阿里網盤。 123&#xff0c;藍奏云&#xff0c;可道云什么的都可以 源碼下載地址&#xff1a;https://www.123865.com/s/X91lVv-3l90v

AXI4-Stream Clock Converter IP

一、參考說明 1.沒有專門對AXI4-Stream Clock Converter IP說明的文檔&#xff1b; 2.可以參考PG085文檔&#xff1b; 3.可以參考PG035文檔&#xff1b; 二、IP的作用 1.用于stream數據流再不同的時鐘域之間的可靠性傳輸&#xff1b; 2.支持跨時鐘域的場景&#xff1b; 3.內部…

NineData 社區版 V4.2.0 發布!新增MySQL與PostgreSQL互相遷移,SQL管理Milvus,安裝更高效

NineData 社區版 V4.2.0 正式發布&#xff01;本次更新通過鏡像輕量化部署、新增 3 條遷移鏈路、新增支持 Milvus 向量數據庫等核心升級&#xff0c;輕松實現數據庫遷移容災、實時數據集成分析、AI 向量數據管理等場景需求。社區版支持本地離線部署&#xff0c;嚴格保障數據隱私…

如何安裝使用qmt腳本跟單聚寬策略

登錄知識星球&#xff0c;下載獲取 解壓后&#xff0c;登錄大qmt&#xff0c;將策略導入其中&#xff0c; 然后修改參數&#xff1a; 點擊免密改參 totalcash&#xff1a;該策略使用資金總量 per&#xff1a;每只股票占比資金額 舉例&#xff0c;當前出信號&#xff0c;每只…

什么是MongoDB

目錄 主要特點 MongoDB概念解析 完整術語列表 MongoDB安裝 MongoDB Shell 安裝MongoDB Shell 數據庫管理 查看數據庫列表 創建數據庫 刪除數據庫 默認數據庫 系統內置數據庫 集合管理 查看集合 創建集合 更新集合名 刪除集合 文檔操作 插入文檔 查詢文檔 …

【Docker基礎】Docker核心概念:容器(Container)與鏡像(Image)的區別與聯系

目錄 引言 1 Docker鏡像&#xff08;Image&#xff09; 1.1 鏡像的定義 1.2 鏡像的特點 1.3 鏡像的創建 1.4 鏡像的結構 1.5 鏡像結構描述 2 Docker容器&#xff08;Container&#xff09; 2.1 容器的定義 2.2 容器的特點 2.3 容器的創建與運行 2.4 容器的生命周期…

從零到一:構建企業級 Vue.js 3 組件庫

前言&#xff1a;為何要構建組件庫&#xff1f; 在現代前端工程化體系中&#xff0c;組件庫已不再是大型團隊的專屬。它是一個團隊設計規范、開發模式和技術沉淀的核心載體。構建一個組件庫&#xff0c;能夠帶來諸多優勢&#xff1a; 提升效率&#xff1a;提供可復用的高質量…

【2025 CVPR-Backbone】Building Vision Models upon Heat Conduction

摘要 利用注意力機制的視覺表示模型在追求大感受野時面臨著巨大的計算開銷。在本研究中&#xff0c;我們通過引入基于物理熱傳導原理的熱傳導算子&#xff08;Heat Conduction Operator, HCO&#xff09;來緩解這一挑戰這么高級咩(⊙o⊙)&#xff01;。HCO將圖像塊視為熱源&am…

Rust編寫Shop管理系統

Rust編寫Shop管理系統 Actix Web 是一個功能強大、實用且速度極快的 Rust Web 框架。編寫Shop管理系統 HelloKeny 首先是先編寫最簡單的例子,類似hello World可以檢查環境 Actix Web 是一個功能強大、實用且速度極快的 Rust Web 框架。 命令 cargo new hellokenycd hell…

安寶特案例丨Vuzix AR智能眼鏡集成專業軟件,助力盧森堡醫院藥房轉型,贏得輝瑞創新獎

在Vuzix M400 AR智能眼鏡的助力下&#xff0c;盧森堡羅伯特舒曼醫院&#xff08;the Robert Schuman Hospitals, HRS&#xff09;憑借在無菌制劑生產流程中引入增強現實技術&#xff08;AR&#xff09;創新項目&#xff0c;榮獲了2024年6月7日由盧森堡醫院藥劑師協會&#xff0…