rename tracker_instance to instance
This commit is contained in:
parent
ed6097388d
commit
2fa4e45818
|
@ -52,7 +52,7 @@ services:
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
./Tools/autotest/sim_vehicle.py $ARDUPILOT_VEHICLE --no-rebuild \
|
./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:
|
profiles:
|
||||||
- uav-sim
|
- uav-sim
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
|
|
16
sim_drone.py
16
sim_drone.py
|
@ -86,7 +86,7 @@ def modified_environ(*remove, **update):
|
||||||
|
|
||||||
|
|
||||||
# @app.command()
|
# @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,
|
"""Starts the simulated drone with a given sys_id,
|
||||||
each drone must have it's own unique 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):
|
with logger.contextualize(syd_id=sys_id):
|
||||||
env = os.environ
|
env = os.environ
|
||||||
with modified_environ(
|
with modified_environ(
|
||||||
SERIAL0_PORT=str(int(env["SERIAL0_PORT"]) + 10 * tracker_instance),
|
SERIAL0_PORT=str(int(env["SERIAL0_PORT"]) + 10 * instance),
|
||||||
MAVROS2_PORT=str(int(env["MAVROS2_PORT"]) + 10 * tracker_instance),
|
MAVROS2_PORT=str(int(env["MAVROS2_PORT"]) + 10 * instance),
|
||||||
MAVROS1_PORT=str(int(env["MAVROS1_PORT"]) + 10 * tracker_instance),
|
MAVROS1_PORT=str(int(env["MAVROS1_PORT"]) + 10 * instance),
|
||||||
FDM_PORT_IN=str(int(env["FDM_PORT_IN"]) + 10 * tracker_instance),
|
FDM_PORT_IN=str(int(env["FDM_PORT_IN"]) + 10 * instance),
|
||||||
SITL_PORT=str(int(env["SITL_PORT"]) + 10 * tracker_instance),
|
SITL_PORT=str(int(env["SITL_PORT"]) + 10 * instance),
|
||||||
TRACKER_INSTANCE=str(tracker_instance),
|
INSTANCE=str(instance),
|
||||||
DRONE_SYS_ID=str(sys_id),
|
DRONE_SYS_ID=str(sys_id),
|
||||||
):
|
):
|
||||||
logger.info("Starting drone stack, this may take some time")
|
logger.info("Starting drone stack, this may take some time")
|
||||||
|
@ -126,7 +126,7 @@ def start_group():
|
||||||
"""Start a group of robots"""
|
"""Start a group of robots"""
|
||||||
for i in range(sim_drone_count):
|
for i in range(sim_drone_count):
|
||||||
logger.info(f"start robot {i}")
|
logger.info(f"start robot {i}")
|
||||||
start(tracker_instance=i, sys_id=i + 1)
|
start(instance=i, sys_id=i + 1)
|
||||||
# if i == 0:
|
# if i == 0:
|
||||||
# wait_for_gazebo()
|
# wait_for_gazebo()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue