Controller Update

This commit is contained in:
2026-02-09 05:51:51 +00:00
parent cd9ae9a4f6
commit 1a616472f0
16 changed files with 1545 additions and 669 deletions

View File

@@ -31,17 +31,21 @@ def generate_launch_description():
'use_ground_truth', default_value='true', description='Use Gazebo ground truth'
)
# Gazebo Harmonic (gz sim) instead of Gazebo Classic
gazebo = ExecuteProcess(
cmd=['gazebo', '--verbose', LaunchConfiguration('world')],
cmd=[
'gz', 'sim', '-v4', '-r',
os.path.expanduser('~/ardupilot_gazebo/worlds/iris_runway.sdf')
],
output='screen',
additional_env={
'GAZEBO_MODEL_PATH': f"{pkg_share}/models:" + os.path.expanduser('~/ardupilot_gazebo/models'),
'GAZEBO_RESOURCE_PATH': f"{pkg_share}/worlds:" + os.path.expanduser('~/ardupilot_gazebo/worlds')
'GZ_SIM_RESOURCE_PATH': f"{pkg_share}/models:{os.path.expanduser('~/ardupilot_gazebo/models')}:{os.path.expanduser('~/ardupilot_gazebo/worlds')}",
'GZ_SIM_SYSTEM_PLUGIN_PATH': os.path.expanduser('~/ardupilot_gazebo/build')
}
)
ardupilot_uav = TimerAction(
period=3.0,
period=5.0, # Wait for Gazebo to initialize
actions=[
ExecuteProcess(
cmd=[
@@ -49,20 +53,20 @@ def generate_launch_description():
'-v', 'ArduCopter',
'-f', 'gazebo-iris',
'--model', 'JSON',
'--map', '--console',
'--no-mavproxy', # Don't start MAVProxy, MAVROS will connect
'-I0',
'--out', '127.0.0.1:14550',
'--out', '127.0.0.1:14551',
'--add-param-file', os.path.join(pkg_share, 'config', 'ardupilot_gps_denied.parm')
],
cwd=os.path.expanduser('~/ardupilot/ArduCopter'),
output='screen'
cwd=os.path.expanduser('~/ardupilot'),
output='screen',
additional_env={
'PATH': os.environ.get('PATH', '') + ':' + os.path.expanduser('~/ardupilot/Tools/autotest')
}
)
]
)
mavros_uav = TimerAction(
period=8.0,
period=15.0, # Wait for ArduPilot SITL to start
actions=[
Node(
package='mavros',
@@ -73,7 +77,7 @@ def generate_launch_description():
parameters=[
os.path.join(pkg_share, 'config', 'mavros_params.yaml'),
{
'fcu_url': 'udp://:14550@127.0.0.1:14555',
'fcu_url': 'tcp://127.0.0.1:5760', # SITL TCP port
'gcs_url': '',
'target_system_id': 1,
'target_component_id': 1,

View File

@@ -14,36 +14,42 @@ def generate_launch_description():
world_arg = DeclareLaunchArgument(
'world',
default_value=os.path.join(pkg_share, 'worlds', 'empty_custom.world'),
description='Path to world file'
default_value='iris_runway.sdf',
description='World file name'
)
# Gazebo Harmonic
gazebo = ExecuteProcess(
cmd=['gazebo', '--verbose', LaunchConfiguration('world')],
cmd=[
'gz', 'sim', '-v4', '-r',
os.path.expanduser('~/ardupilot_gazebo/worlds/iris_runway.sdf')
],
output='screen',
additional_env={
'GAZEBO_MODEL_PATH': f"{pkg_share}/models:" + os.path.expanduser('~/ardupilot_gazebo/models'),
'GZ_SIM_RESOURCE_PATH': f"{pkg_share}/models:{os.path.expanduser('~/ardupilot_gazebo/models')}:{os.path.expanduser('~/ardupilot_gazebo/worlds')}",
'GZ_SIM_SYSTEM_PLUGIN_PATH': os.path.expanduser('~/ardupilot_gazebo/build')
}
)
ardupilot = TimerAction(
period=3.0,
period=5.0,
actions=[
ExecuteProcess(
cmd=[
'sim_vehicle.py', '-v', 'ArduCopter', '-f', 'gazebo-iris',
'--model', 'JSON', '--map', '--console', '-I0',
'--out', '127.0.0.1:14550',
'--add-param-file', os.path.join(pkg_share, 'config', 'ardupilot_gps_denied.parm')
'--model', 'JSON', '--no-mavproxy', '-I0',
],
cwd=os.path.expanduser('~/ardupilot/ArduCopter'),
output='screen'
cwd=os.path.expanduser('~/ardupilot'),
output='screen',
additional_env={
'PATH': os.environ.get('PATH', '') + ':' + os.path.expanduser('~/ardupilot/Tools/autotest')
}
)
]
)
mavros = TimerAction(
period=8.0,
period=15.0,
actions=[
Node(
package='mavros',
@@ -53,7 +59,7 @@ def generate_launch_description():
output='screen',
parameters=[
os.path.join(pkg_share, 'config', 'mavros_params.yaml'),
{'fcu_url': 'udp://:14550@127.0.0.1:14555'}
{'fcu_url': 'tcp://127.0.0.1:5760'}
]
)
]