rename tracker_instance to instance

This commit is contained in:
Burak Ozter 2024-11-04 17:29:16 -04:00
parent ed6097388d
commit 2fa4e45818
2 changed files with 9 additions and 9 deletions

View File

@ -52,7 +52,7 @@ services:
- -c
- |
./Tools/autotest/sim_vehicle.py $ARDUPILOT_VEHICLE --no-rebuild \
--no-mavproxy --enable-dds --sysid $DRONE_SYS_ID -I$TRACKER_INSTANCE
--no-mavproxy --enable-dds --sysid $DRONE_SYS_ID -I$INSTANCE
profiles:
- uav-sim
stdin_open: true

View File

@ -86,7 +86,7 @@ def modified_environ(*remove, **update):
# @app.command()
def start(tracker_instance: int = 0, sys_id: int = 1):
def start(instance: int = 0, sys_id: int = 1):
"""Starts the simulated drone with a given sys_id,
each drone must have it's own unique ID.
"""
@ -96,12 +96,12 @@ def start(tracker_instance: int = 0, sys_id: int = 1):
with logger.contextualize(syd_id=sys_id):
env = os.environ
with modified_environ(
SERIAL0_PORT=str(int(env["SERIAL0_PORT"]) + 10 * tracker_instance),
MAVROS2_PORT=str(int(env["MAVROS2_PORT"]) + 10 * tracker_instance),
MAVROS1_PORT=str(int(env["MAVROS1_PORT"]) + 10 * tracker_instance),
FDM_PORT_IN=str(int(env["FDM_PORT_IN"]) + 10 * tracker_instance),
SITL_PORT=str(int(env["SITL_PORT"]) + 10 * tracker_instance),
TRACKER_INSTANCE=str(tracker_instance),
SERIAL0_PORT=str(int(env["SERIAL0_PORT"]) + 10 * instance),
MAVROS2_PORT=str(int(env["MAVROS2_PORT"]) + 10 * instance),
MAVROS1_PORT=str(int(env["MAVROS1_PORT"]) + 10 * instance),
FDM_PORT_IN=str(int(env["FDM_PORT_IN"]) + 10 * instance),
SITL_PORT=str(int(env["SITL_PORT"]) + 10 * instance),
INSTANCE=str(instance),
DRONE_SYS_ID=str(sys_id),
):
logger.info("Starting drone stack, this may take some time")
@ -126,7 +126,7 @@ def start_group():
"""Start a group of robots"""
for i in range(sim_drone_count):
logger.info(f"start robot {i}")
start(tracker_instance=i, sys_id=i + 1)
start(instance=i, sys_id=i + 1)
# if i == 0:
# wait_for_gazebo()