Skip to content

Spa database inclusion #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added CustomRobots/f1/models/spa/meshes/Arena.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/arboles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/arbolesD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/arbolesI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/asfalto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/asfaltoD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/asfaltoI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/asfaltoSpa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/hierba.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/hierbaD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/hierbaI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/pianoArenaI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/pianoDer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/pianoHD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomRobots/f1/models/spa/meshes/pianoHI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
719 changes: 719 additions & 0 deletions CustomRobots/f1/models/spa/meshes/spa.dae

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions CustomRobots/f1/models/spa/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<model>
<name>spa_circuit</name>
<version>1.0</version>
<sdf version="1.7">model.sdf</sdf>
<author>
<name>Fernando Exposito Arribas</name>
</author>
<description>
Modelo del circuito de Spa para Gazebo Sim.
</description>
</model>
23 changes: 23 additions & 0 deletions CustomRobots/f1/models/spa/model.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<sdf version="1.7">

<model name="spa_circuit">
<static>true</static>
<link name="link">
<visual name="visual">
<geometry>
<mesh>
<uri>model://spa/meshes/spa.dae</uri>
</mesh>
</geometry>
</visual>
<collision name="collision">
<geometry>
<mesh>
<uri>model://spa/meshes/spa.dae</uri>
</mesh>
</geometry>
</collision>
</link>
</model>
</sdf>
52 changes: 52 additions & 0 deletions CustomRobots/f1/worlds/spa_circuit.world
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<sdf version='1.10'>
<world name='spa'>
<physics name='1ms' type='ignored'>
<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>
<plugin name='gz::sim::systems::Physics' filename='gz-sim-physics-system'/>
<plugin name='gz::sim::systems::UserCommands' filename='gz-sim-user-commands-system'/>
<plugin name='gz::sim::systems::SceneBroadcaster' filename='gz-sim-scene-broadcaster-system'/>
<plugin name='gz::sim::systems::Contact' filename='gz-sim-contact-system'/>
<gravity>0 0 -9.8</gravity>
<atmosphere type='adiabatic'/>
<scene>
<ambient>0.4 0.4 0.4 1</ambient>
<background>0.7 0.7 0.7 1</background>
<shadows>true</shadows>
<grid>false</grid>
<sky>
<clouds>
<speed>12</speed>
</clouds>
</sky>
</scene>

<include>
<uri>model://spa</uri>
<name>spa</name>
<pose>0 0 -1000 0 0 0</pose>
</include>

<light name='my_sun' type='directional'>
<pose>0 0 10 0 0 0</pose>
<cast_shadows>true</cast_shadows>
<intensity>1</intensity>
<direction>-0.5 0.1 -0.9</direction>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.2 0.2 0.2 1</specular>
<attenuation>
<range>1000</range>
<linear>0.01</linear>
<constant>0.9</constant>
<quadratic>0.001</quadratic>
</attenuation>
<spot>
<inner_angle>0</inner_angle>
<outer_angle>0</outer_angle>
<falloff>0</falloff>
</spot>
</light>
</world>
</sdf>
71 changes: 71 additions & 0 deletions Launchers/monaco_circuit.launch .py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import os
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.substitutions import FindPackageShare

def generate_launch_description():

# Aquí el paquete correcto para gazebo_ros
pkg_gazebo_ros = FindPackageShare(package='gazebo_launch').find('gazebo_launch')

# Ruta a tu carpeta de modelos en tu workspace (ajusta si es necesario)
# Si tus modelos están en ~/gzROS/src/gazebo_launch/worlds/models o similar, pon esa ruta:
pkg_share = os.path.expanduser('~/gzROS/src/gazebo_launch/models')

# Nombre del archivo del mundo
world_file_name = 'monaco_circuit.world'
world_path = os.path.join(pkg_share, world_file_name)

# Añadir el path de modelos a la variable de entorno GAZEBO_MODEL_PATH
os.environ["GAZEBO_MODEL_PATH"] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{pkg_share}"

# Configuraciones de lanzamiento
headless = LaunchConfiguration('headless')
use_sim_time = LaunchConfiguration('use_sim_time')
use_simulator = LaunchConfiguration('use_simulator')
world = LaunchConfiguration('world')

declare_simulator_cmd = DeclareLaunchArgument(
name='headless',
default_value='False',
description='Whether to execute gzclient'
)

declare_use_sim_time_cmd = DeclareLaunchArgument(
name='use_sim_time',
default_value='true',
description='Use simulation (Gazebo) clock if true'
)

declare_use_simulator_cmd = DeclareLaunchArgument(
name='use_simulator',
default_value='True',
description='Whether to start the simulator'
)

declare_world_cmd = DeclareLaunchArgument(
name='world',
default_value=world_path,
description='Full path to the world model file to load'
)

# Lanzar el servidor de Gazebo
start_gazebo_server_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(pkg_gazebo_ros, 'launch', 'gazebo.launch.py')),
condition=IfCondition(use_simulator),
launch_arguments={'world': world}.items()
)

ld = LaunchDescription()

ld.add_action(declare_simulator_cmd)
ld.add_action(declare_use_sim_time_cmd)
ld.add_action(declare_use_simulator_cmd)
ld.add_action(declare_world_cmd)

ld.add_action(start_gazebo_server_cmd)

return ld
71 changes: 71 additions & 0 deletions Launchers/spa_circuit.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import os
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.substitutions import FindPackageShare

def generate_launch_description():

# Aquí el paquete correcto para gazebo_ros
pkg_gazebo_ros = FindPackageShare(package='gazebo_launch').find('gazebo_launch')

# Ruta a tu carpeta de modelos en tu workspace (ajusta si es necesario)
# Si tus modelos están en ~/gzROS/src/gazebo_launch/worlds/models o similar, pon esa ruta:
pkg_share = os.path.expanduser('~/gzROS/src/gazebo_launch/models')

# Nombre del archivo del mundo
world_file_name = 'spa_circuit.world'
world_path = os.path.join(pkg_share, world_file_name)

# Añadir el path de modelos a la variable de entorno GAZEBO_MODEL_PATH
os.environ["GAZEBO_MODEL_PATH"] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{pkg_share}"

# Configuraciones de lanzamiento
headless = LaunchConfiguration('headless')
use_sim_time = LaunchConfiguration('use_sim_time')
use_simulator = LaunchConfiguration('use_simulator')
world = LaunchConfiguration('world')

declare_simulator_cmd = DeclareLaunchArgument(
name='headless',
default_value='False',
description='Whether to execute gzclient'
)

declare_use_sim_time_cmd = DeclareLaunchArgument(
name='use_sim_time',
default_value='true',
description='Use simulation (Gazebo) clock if true'
)

declare_use_simulator_cmd = DeclareLaunchArgument(
name='use_simulator',
default_value='True',
description='Whether to start the simulator'
)

declare_world_cmd = DeclareLaunchArgument(
name='world',
default_value=world_path,
description='Full path to the world model file to load'
)

# Lanzar el servidor de Gazebo
start_gazebo_server_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(pkg_gazebo_ros, 'launch', 'gazebo.launch.py')),
condition=IfCondition(use_simulator),
launch_arguments={'world': world}.items()
)

ld = LaunchDescription()

ld.add_action(declare_simulator_cmd)
ld.add_action(declare_use_sim_time_cmd)
ld.add_action(declare_use_simulator_cmd)
ld.add_action(declare_world_cmd)

ld.add_action(start_gazebo_server_cmd)

return ld
50 changes: 50 additions & 0 deletions Worlds/spa_circuit.world
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<sdf version='1.10'>
<world name='spa'>
<physics name='1ms' type='ignored'>
<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>
<plugin name='gz::sim::systems::Physics' filename='gz-sim-physics-system'/>
<plugin name='gz::sim::systems::UserCommands' filename='gz-sim-user-commands-system'/>
<plugin name='gz::sim::systems::SceneBroadcaster' filename='gz-sim-scene-broadcaster-system'/>
<plugin name='gz::sim::systems::Contact' filename='gz-sim-contact-system'/>
<gravity>0 0 -9.8</gravity>
<atmosphere type='adiabatic'/>
<scene>
<ambient>0.4 0.4 0.4 1</ambient>
<background>0.7 0.7 0.7 1</background>
<shadows>true</shadows>
<grid>false</grid>
<sky>
<clouds>
<speed>12</speed>
</clouds>
</sky>
</scene>
<include>
<uri>model://spa</uri>
<name>spa</name>
<pose>0 0 -1000 0 0 0</pose>
</include>
<light name='my_sun' type='directional'>
<pose>0 0 10 0 0 0</pose>
<cast_shadows>true</cast_shadows>
<intensity>1</intensity>
<direction>-0.5 0.1 -0.9</direction>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.2 0.2 0.2 1</specular>
<attenuation>
<range>1000</range>
<linear>0.01</linear>
<constant>0.9</constant>
<quadratic>0.001</quadratic>
</attenuation>
<spot>
<inner_angle>0</inner_angle>
<outer_angle>0</outer_angle>
<falloff>0</falloff>
</spot>
</light>
</world>
</sdf>
4 changes: 4 additions & 0 deletions database/universes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ COPY public.universes (id, name, world_id, robot_id) FROM stdin;
32 Follow Road Harmonic 32 0
33 Laser Mapping Warehouse 12 0
34 Pick And Place World 34 0
35 Spa Circuit 33 0
36 Monaco Circuit 34 0
\.


Expand Down Expand Up @@ -192,6 +194,8 @@ COPY public.worlds (id, name, launch_file_path, visualization_config_path, ros_v
32 Follow Road Harmonic /opt/jderobot/Launchers/follow_road.launch.py /opt/jderobot/Launchers/visualization/follow_road.config ROS2 gzsim_rae gazebo {0.0,0.0,0.0,0.0,0.0,0.0}
33 Small Laser Mapping Warehouse /opt/jderobot/Launchers/small_laser_mapping.launch.py /opt/jderobot/Launchers/visualization/small_laser_mapping.config ROS2 gzsim_rae gazebo {0.0,0.0,0.0,0.0,0.0,0.0}
34 Pick And Place Arm /home/dev_ws/src/IndustrialRobots/ros2_SimRealRobotControl/ros2srrc_launch/moveit2/moveit2.launch.py None ROS2 gazebo_rae gazebo {0.0,0.0,0.0,0.0,0.0,0.0}
35 Spa Circuit /opt/jderobot/Launchers/spa_circuit.launch.py None ROS2 gazebo_rae gazebo {0.0,0.0,0.0,0.0,0.0,0.0}
36 Monaco Circuit /opt/jderobot/Launchers/monaco_circuit.launch.py None ROS2 gazebo_rae gazebo {0.0,0.0,0.0,0.0,0.0,0.0}
\.
-- 34 Pick And Place Arm /opt/jderobot/Launchers/pick_place.launch.py None ROS2 gazebo_rae gazebo {0.0,0.0,0.0,0.0,0.0,0.0}

Expand Down
Loading