forked from zbw/yiliao2026
目前完成了比赛地图的建图,但是还没有实现定位导航
This commit is contained in:
@@ -13,7 +13,7 @@ find_package(ament_cmake REQUIRED)
|
||||
# 查找slam_toolbox包
|
||||
find_package(slam_toolbox REQUIRED)
|
||||
install(
|
||||
DIRECTORY launch config params maps
|
||||
DIRECTORY launch config params maps world
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
if(BUILD_TESTING)
|
||||
|
||||
@@ -12,7 +12,7 @@ slam_toolbox:
|
||||
# ============================ ROS 基础参数 =========================================
|
||||
odom_frame: odom # 里程计坐标系
|
||||
map_frame: map # 地图坐标系
|
||||
base_frame: base_link # 机器人基座坐标系
|
||||
base_frame: base_footprint # 机器人基座坐标系(与 URDF 根帧一致)
|
||||
scan_topic: /scan # 激光雷达话题
|
||||
use_map_saver: true # 启用地图保存功能
|
||||
mode: mapping # mapping = 定位 + 实时建图(地图可更新)
|
||||
|
||||
196
src/gc_navigation2_slamtoolbox/launch/gc_slam_mapping.launch.py
Normal file
196
src/gc_navigation2_slamtoolbox/launch/gc_slam_mapping.launch.py
Normal file
@@ -0,0 +1,196 @@
|
||||
#!/usr/bin/env python3
|
||||
# ============================================================================
|
||||
# gc_slam_mapping.launch.py
|
||||
# 功能:Gazebo 仿真环境 + SLAM 建图启动文件
|
||||
#
|
||||
# 适用场景:
|
||||
# - 在 Gazebo 仿真中遥控机器人建立环境地图
|
||||
# - 在已有地图基础上增量更新
|
||||
# - 单独调试 slam_toolbox 建图参数
|
||||
#
|
||||
# 架构:
|
||||
# Gazebo 仿真器 — 加载 zhihui.world(智慧楼墙体环境)
|
||||
# spawn_entity — 在 Gazebo 中生成机器人模型
|
||||
# robot_state_publisher — 发布机器人 TF 树(URDF 模型)
|
||||
# joint_state_publisher — 发布关节状态
|
||||
# async_slam_toolbox_node — 激光 SLAM 建图(mapping 模式)
|
||||
# 发布 map→odom TF
|
||||
# 发布 /map 话题(实时地图)
|
||||
#
|
||||
# 使用方式:
|
||||
# ros2 launch gc_navigation2_slamtoolbox gc_slam_mapping.launch.py
|
||||
#
|
||||
# 保存地图:
|
||||
# ros2 service call /slam_toolbox/serialize_map slam_toolbox/srv/SerializePoseGraph \
|
||||
# "{filename: '/home/guoch/test_ws/src/gc_navigation2_slamtoolbox/maps/my_map'}"
|
||||
# ros2 run nav2_map_server map_saver_cli -f <map_name>
|
||||
# ============================================================================
|
||||
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, ExecuteProcess, SetEnvironmentVariable
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
from launch_ros.parameter_descriptions import ParameterValue
|
||||
from launch.substitutions import Command
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
"""生成 LaunchDescription,启动 Gazebo + slam_toolbox 建图"""
|
||||
|
||||
# ============================ 1. 包路径 =========================================
|
||||
pkg_dir = get_package_share_directory('gc_navigation2_slamtoolbox')
|
||||
origincar_urdf_dir = get_package_share_directory('origincar_description')
|
||||
|
||||
# ============================ 2. 声明启动参数 ====================================
|
||||
use_sim_time = LaunchConfiguration('use_sim_time', default='true')
|
||||
|
||||
# slam_params_file: slam_toolbox 配置文件
|
||||
slam_params_file = LaunchConfiguration(
|
||||
'slam_params_file',
|
||||
default=os.path.join(pkg_dir, 'config', 'slam_toolbox_async.yaml'))
|
||||
|
||||
# map_file_name: 可选,加载已有序列化地图继续建图
|
||||
map_file_name = LaunchConfiguration('map_file_name', default='')
|
||||
|
||||
# model: 机器人 URDF 模型路径(用于 xacro 处理)
|
||||
# origincar.urdf 是纯 URDF(不含 xacro 宏),xacro 会原样透传
|
||||
default_model_path = os.path.join(
|
||||
origincar_urdf_dir, 'urdf', 'origincar.urdf')
|
||||
model = DeclareLaunchArgument(
|
||||
name='model', default_value=default_model_path)
|
||||
|
||||
# spawn_model: Gazebo 中生成机器人用的 URDF(不含 xacro 宏)
|
||||
spawn_model_path = os.path.join(
|
||||
origincar_urdf_dir, 'urdf', 'origincar.urdf')
|
||||
|
||||
# ============================ 3. 设置 GAZEBO_MODEL_PATH ==========================
|
||||
# 让 Gazebo 能找到 zhihui 模型,同时保留标准模型路径
|
||||
gazebo_model_path = os.path.join(pkg_dir, 'world')
|
||||
existing_gazebo_path = os.environ.get('GAZEBO_MODEL_PATH', '')
|
||||
if existing_gazebo_path:
|
||||
full_gazebo_path = f'{gazebo_model_path}:{existing_gazebo_path}'
|
||||
else:
|
||||
full_gazebo_path = gazebo_model_path
|
||||
set_gazebo_model_path = SetEnvironmentVariable(
|
||||
name='GAZEBO_MODEL_PATH',
|
||||
value=full_gazebo_path
|
||||
)
|
||||
|
||||
# ============================ 4. 启动 Gazebo 仿真器 ==============================
|
||||
gazebo_world_path = os.path.join(pkg_dir, 'world', 'zhihui.world')
|
||||
start_gazebo_cmd = ExecuteProcess(
|
||||
cmd=['gazebo', '--verbose',
|
||||
'-s', 'libgazebo_ros_init.so',
|
||||
'-s', 'libgazebo_ros_factory.so',
|
||||
gazebo_world_path],
|
||||
output='screen'
|
||||
)
|
||||
|
||||
# ============================ 5. 机器人初始位姿参数 ==============================
|
||||
# 通过命令行参数覆盖,例如:
|
||||
# ros2 launch ... spawn_x:=1.0 spawn_y:=-2.0 spawn_yaw:=1.57
|
||||
spawn_x = LaunchConfiguration('spawn_x', default='-4.311092')
|
||||
spawn_y = LaunchConfiguration('spawn_y', default='-4.299756')
|
||||
spawn_z = LaunchConfiguration('spawn_z', default='0.0')
|
||||
spawn_yaw = LaunchConfiguration('spawn_yaw', default='0.0')
|
||||
|
||||
# 将位姿参数设为环境变量,供 spawn 命令使用
|
||||
set_spawn_x = SetEnvironmentVariable('SPAWN_X', spawn_x)
|
||||
set_spawn_y = SetEnvironmentVariable('SPAWN_Y', spawn_y)
|
||||
set_spawn_z = SetEnvironmentVariable('SPAWN_Z', spawn_z)
|
||||
set_spawn_yaw = SetEnvironmentVariable('SPAWN_YAW', spawn_yaw)
|
||||
|
||||
# ============================ 6. 在 Gazebo 中生成机器人 ==========================
|
||||
# 通过 bash 读取环境变量,确保位姿参数正确传递
|
||||
robot_name_in_model = 'mycar'
|
||||
spawn_entity_cmd = ExecuteProcess(
|
||||
cmd=['bash', '-c',
|
||||
'ros2 run gazebo_ros spawn_entity.py '
|
||||
'-entity mycar '
|
||||
f'-file {spawn_model_path} '
|
||||
'-x $SPAWN_X -y $SPAWN_Y -z $SPAWN_Z -Y $SPAWN_YAW'],
|
||||
output='screen'
|
||||
)
|
||||
|
||||
# ============================ 7. robot_state_publisher ===========================
|
||||
robot_description = ParameterValue(
|
||||
Command(['xacro ', LaunchConfiguration('model')]),
|
||||
value_type=str
|
||||
)
|
||||
robot_state_publisher_node = Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
output='screen',
|
||||
parameters=[{
|
||||
'robot_description': robot_description,
|
||||
'use_sim_time': True,
|
||||
'publish_frequency': 30.0,
|
||||
}],
|
||||
)
|
||||
|
||||
# ============================ 8. joint_state_publisher ===========================
|
||||
joint_state_publisher_node = Node(
|
||||
package='joint_state_publisher',
|
||||
executable='joint_state_publisher',
|
||||
name='joint_state_publisher',
|
||||
output='screen',
|
||||
parameters=[{'use_sim_time': use_sim_time}],
|
||||
)
|
||||
|
||||
# ============================ 9. slam_toolbox 建图节点 ============================
|
||||
slam_toolbox_node = Node(
|
||||
package='slam_toolbox',
|
||||
executable='async_slam_toolbox_node',
|
||||
name='slam_toolbox',
|
||||
output='screen',
|
||||
parameters=[
|
||||
slam_params_file,
|
||||
{
|
||||
'use_sim_time': use_sim_time,
|
||||
'map_file_name': map_file_name,
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
# ============================ 10. 组装 LaunchDescription =========================
|
||||
return LaunchDescription([
|
||||
DeclareLaunchArgument(
|
||||
'use_sim_time',
|
||||
default_value='true',
|
||||
description='使用仿真时间(Gazebo=true, 实车=false)'),
|
||||
DeclareLaunchArgument(
|
||||
'slam_params_file',
|
||||
default_value=os.path.join(pkg_dir, 'config', 'slam_toolbox_async.yaml'),
|
||||
description='slam_toolbox 参数配置文件路径'),
|
||||
DeclareLaunchArgument(
|
||||
'map_file_name',
|
||||
default_value='',
|
||||
description='已有序列化地图路径(.posegraph),留空则从零开始建图'),
|
||||
DeclareLaunchArgument(
|
||||
'spawn_x', default_value='-4.311092',
|
||||
description='机器人初始 x 坐标(m)'),
|
||||
DeclareLaunchArgument(
|
||||
'spawn_y', default_value='-4.299756',
|
||||
description='机器人初始 y 坐标(m)'),
|
||||
DeclareLaunchArgument(
|
||||
'spawn_z', default_value='0.0',
|
||||
description='机器人初始 z 坐标(m)'),
|
||||
DeclareLaunchArgument(
|
||||
'spawn_yaw', default_value='0.0',
|
||||
description='机器人初始偏航角(rad)'),
|
||||
model,
|
||||
|
||||
set_gazebo_model_path,
|
||||
set_spawn_x,
|
||||
set_spawn_y,
|
||||
set_spawn_z,
|
||||
set_spawn_yaw,
|
||||
start_gazebo_cmd,
|
||||
spawn_entity_cmd,
|
||||
robot_state_publisher_node,
|
||||
joint_state_publisher_node,
|
||||
slam_toolbox_node,
|
||||
])
|
||||
BIN
src/gc_navigation2_slamtoolbox/maps/zhihui.data
Normal file
BIN
src/gc_navigation2_slamtoolbox/maps/zhihui.data
Normal file
Binary file not shown.
BIN
src/gc_navigation2_slamtoolbox/maps/zhihui.pgm
Normal file
BIN
src/gc_navigation2_slamtoolbox/maps/zhihui.pgm
Normal file
Binary file not shown.
BIN
src/gc_navigation2_slamtoolbox/maps/zhihui.posegraph
Normal file
BIN
src/gc_navigation2_slamtoolbox/maps/zhihui.posegraph
Normal file
Binary file not shown.
7
src/gc_navigation2_slamtoolbox/maps/zhihui.yaml
Normal file
7
src/gc_navigation2_slamtoolbox/maps/zhihui.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
image: zhihui.pgm
|
||||
mode: trinary
|
||||
resolution: 0.05
|
||||
origin: [-4.98, -4.71, 0]
|
||||
negate: 0
|
||||
occupied_thresh: 0.65
|
||||
free_thresh: 0.25
|
||||
11
src/gc_navigation2_slamtoolbox/world/zhihui/model.config
Normal file
11
src/gc_navigation2_slamtoolbox/world/zhihui/model.config
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" ?>
|
||||
<model>
|
||||
<name>zhihui</name>
|
||||
<version>1.0</version>
|
||||
<sdf version="1.7">model.sdf</sdf>
|
||||
<author>
|
||||
<name></name>
|
||||
<email></email>
|
||||
</author>
|
||||
<description></description>
|
||||
</model>
|
||||
471
src/gc_navigation2_slamtoolbox/world/zhihui/model.sdf
Normal file
471
src/gc_navigation2_slamtoolbox/world/zhihui/model.sdf
Normal file
@@ -0,0 +1,471 @@
|
||||
<?xml version='1.0'?>
|
||||
<sdf version='1.7'>
|
||||
<model name='zhihui'>
|
||||
<pose>-2.11635 -1.73906 0 0 -0 0</pose>
|
||||
<link name='Wall_12'>
|
||||
<collision name='Wall_12_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_12_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>-1.61999 -0.744014 0 0 -0 0</pose>
|
||||
</link>
|
||||
<link name='Wall_15'>
|
||||
<collision name='Wall_15_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_15_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>1.62754 -0.744014 0 0 -0 0</pose>
|
||||
</link>
|
||||
<link name='Wall_17'>
|
||||
<collision name='Wall_17_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_17_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>-0.827543 -0.3078 0 0 -0 1.5708</pose>
|
||||
</link>
|
||||
<link name='Wall_19'>
|
||||
<collision name='Wall_19_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_19_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>0.327543 -0.319014 0 0 -0 1.5708</pose>
|
||||
</link>
|
||||
<link name='Wall_2'>
|
||||
<collision name='Wall_2_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>5 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_2_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>5 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>0.062177 -2.89677 0 0 -0 0</pose>
|
||||
</link>
|
||||
<link name='Wall_29'>
|
||||
<collision name='Wall_29_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>3.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_29_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>3.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>-0.305988 0.758719 0 0 -0 0</pose>
|
||||
</link>
|
||||
<link name='Wall_31'>
|
||||
<collision name='Wall_31_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>3.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_31_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>3.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>-0.300519 2.09188 0 0 -0 0</pose>
|
||||
</link>
|
||||
<link name='Wall_33'>
|
||||
<collision name='Wall_33_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1.5 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_33_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1.5 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>1.65085 1.41824 0 0 -0 -1.5708</pose>
|
||||
</link>
|
||||
<link name='Wall_36'>
|
||||
<collision name='Wall_36_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_36_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2.75 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>2.3125 1.40828 0 0 -0 1.5708</pose>
|
||||
</link>
|
||||
<link name='Wall_38'>
|
||||
<collision name='Wall_38_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>5.25 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_38_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>5.25 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>-0.19189 2.74413 0 0 -0 3.14159</pose>
|
||||
</link>
|
||||
<link name='Wall_4'>
|
||||
<collision name='Wall_4_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_4_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>2.6265 -1.8264 0 0 -0 1.5708</pose>
|
||||
</link>
|
||||
<link name='Wall_40'>
|
||||
<collision name='Wall_40_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1.5 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_40_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>1.5 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>-2.25486 1.43754 0 0 -0 -1.5708</pose>
|
||||
</link>
|
||||
<link name='Wall_44'>
|
||||
<collision name='Wall_44_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>3 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_44_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>3 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>-2.89932 1.47176 0 0 -0 -1.5708</pose>
|
||||
</link>
|
||||
<link name='Wall_46'>
|
||||
<collision name='Wall_46_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2.25 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_46_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2.25 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>-1.87754 0.1172 0 0 -0 3.14159</pose>
|
||||
</link>
|
||||
<link name='Wall_48'>
|
||||
<collision name='Wall_48_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2.13496 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_48_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2.13496 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>1.32002 0.107134 0 0 -0 0.001157</pose>
|
||||
</link>
|
||||
<link name='Wall_6'>
|
||||
<collision name='Wall_6_Collision'>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
</collision>
|
||||
<visual name='Wall_6_Visual'>
|
||||
<pose>0 0 1.25 0 -0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>2 0.15 2.5</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
<ambient>1 1 1 1</ambient>
|
||||
</material>
|
||||
<meta>
|
||||
<layer>0</layer>
|
||||
</meta>
|
||||
</visual>
|
||||
<pose>-2.50971 -1.81518 0 0 -0 1.5708</pose>
|
||||
</link>
|
||||
<static>1</static>
|
||||
</model>
|
||||
</sdf>
|
||||
79
src/origincar_description/world/zhihui.world
Normal file
79
src/origincar_description/world/zhihui.world
Normal file
@@ -0,0 +1,79 @@
|
||||
<sdf version='1.7'>
|
||||
<world name='default'>
|
||||
<!-- ===== 光照 ===== -->
|
||||
<light name='sun' type='directional'>
|
||||
<cast_shadows>1</cast_shadows>
|
||||
<pose>0 0 10 0 -0 0</pose>
|
||||
<diffuse>0.8 0.8 0.8 1</diffuse>
|
||||
<specular>0.2 0.2 0.2 1</specular>
|
||||
<attenuation>
|
||||
<range>1000</range>
|
||||
<constant>0.9</constant>
|
||||
<linear>0.01</linear>
|
||||
<quadratic>0.001</quadratic>
|
||||
</attenuation>
|
||||
<direction>-0.5 0.1 -0.9</direction>
|
||||
</light>
|
||||
|
||||
<!-- ===== 地面 ===== -->
|
||||
<model name='ground_plane'>
|
||||
<static>1</static>
|
||||
<link name='link'>
|
||||
<collision name='collision'>
|
||||
<geometry>
|
||||
<plane>
|
||||
<normal>0 0 1</normal>
|
||||
<size>100 100</size>
|
||||
</plane>
|
||||
</geometry>
|
||||
<surface>
|
||||
<friction>
|
||||
<ode>
|
||||
<mu>100</mu>
|
||||
<mu2>50</mu2>
|
||||
</ode>
|
||||
</friction>
|
||||
<contact>
|
||||
<ode />
|
||||
</contact>
|
||||
</surface>
|
||||
</collision>
|
||||
<visual name='visual'>
|
||||
<cast_shadows>0</cast_shadows>
|
||||
<geometry>
|
||||
<plane>
|
||||
<normal>0 0 1</normal>
|
||||
<size>100 100</size>
|
||||
</plane>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
<name>Gazebo/Grey</name>
|
||||
</script>
|
||||
</material>
|
||||
</visual>
|
||||
</link>
|
||||
</model>
|
||||
|
||||
<!-- ===== 智慧楼墙体模型 ===== -->
|
||||
<include>
|
||||
<uri>model://zhihui</uri>
|
||||
</include>
|
||||
|
||||
<!-- ===== 物理引擎 ===== -->
|
||||
<gravity>0 0 -9.8</gravity>
|
||||
<physics type='ode'>
|
||||
<max_step_size>0.001</max_step_size>
|
||||
<real_time_factor>1</real_time_factor>
|
||||
<real_time_update_rate>1000</real_time_update_rate>
|
||||
</physics>
|
||||
|
||||
<!-- ===== 场景 ===== -->
|
||||
<scene>
|
||||
<ambient>0.4 0.4 0.4 1</ambient>
|
||||
<background>0.7 0.7 0.7 1</background>
|
||||
<shadows>1</shadows>
|
||||
</scene>
|
||||
</world>
|
||||
</sdf>
|
||||
Reference in New Issue
Block a user