Broadcast Communication
By default, communication occurs between all satellites that are specified by the communication method. This tutorial shows how to use two classes to configure a broadcast action that must be taken for communication to occur:
Broadcast, which gives satellites an action that enables communication from them at the end of the current step.
BroadcastCommunication, which can be combined with another communication method to limit communication from broadcasters to those satellites satisfying the requirements of the other communication method.
Configuring the Environment
For this example, a multisatellite target imaging environment will be used. The goal is to maximize the value of unique images taken. This configuration is similar to the Multi-Agent Environments example.
[1]:
from bsk_rl import sats, act, obs, scene, data, comm
from bsk_rl.sim import dyn, fsw
class ImagingSatellite(sats.ImagingSatellite):
observation_spec = [
obs.OpportunityProperties(
dict(prop="priority"),
dict(prop="opportunity_open", norm=5700.0),
n_ahead_observe=4,
)
]
action_spec = [act.Broadcast(duration=15.0), act.Image(n_ahead_image=4)]
dyn_type = dyn.FullFeaturedDynModel
fsw_type = fsw.SteeringImagerFSWModel
ACTION_BROADCAST = 0
ACTION_IMAGE_0 = 1
ACTION_IMAGE_1 = 2
ACTION_IMAGE_2 = 3
ACTION_IMAGE_3 = 4
Satellite properties are set to give the satellite near-unlimited power and storage resources. To randomize some parameters in a correlated manner across satellites, a sat_arg_randomizer is set and passed to the environment. In this case, the satellites are distributed in a trivial single-plane Walker-delta constellation.
[2]:
from bsk_rl.utils.orbital import walker_delta_args
N_AGENTS = 2
sat_args = dict(
imageAttErrorRequirement=0.01,
imageRateErrorRequirement=0.01,
batteryStorageCapacity=1e9,
storedCharge_Init=1e9,
dataStorageCapacity=1e12,
u_max=0.4,
K1=0.25,
K3=3.0,
omega_max=0.087,
servo_Ki=5.0,
servo_P=150 / 5,
)
sat_arg_randomizer = walker_delta_args(
altitude=800.0, inc=60.0, n_planes=1, clustersize=N_AGENTS, clusterspacing=5.0
)
A communication type is defined that uses multidegree line-of-sight communication with broadcasting.
[3]:
class BroadcastLOS(comm.BroadcastCommunication, comm.LOSMultiCommunication):
pass
Finally, the environment can be instantiated.
[4]:
from bsk_rl import ConstellationTasking
env = ConstellationTasking(
satellites=[ImagingSatellite(f"EO-{i + 1}", sat_args) for i in range(N_AGENTS)],
scenario=scene.UniformTargets(1000),
rewarder=data.UniqueImageReward(),
communicator=BroadcastLOS(),
sat_arg_randomizer=sat_arg_randomizer,
log_level="INFO",
)
_ = env.reset()
2026-07-18 03:50:32,542 gym INFO Resetting environment with seed=4107837554
2026-07-18 03:50:32,544 scene.targets INFO Generating 1000 targets
/home/runner/work/bsk_rl/bsk_rl/src/bsk_rl/sim/dyn/base.py:330: BSKDeprecationWarning: Basilisk.utilities.unitTestSupport.np2EigenMatrix3d will be removed after 2027-06-23: Use simHelpers.np2EigenMatrix3d instead.
self.scObject.hub.IHubPntBc_B = unitTestSupport.np2EigenMatrix3d(self.I_mat)
/home/runner/work/bsk_rl/bsk_rl/src/bsk_rl/sim/dyn/base.py:335: BSKDeprecationWarning: Basilisk.utilities.unitTestSupport.np2EigenVectorXd will be removed after 2027-06-23: Use simHelpers.np2EigenVectorXd instead.
self.scObject.hub.r_CN_NInit = unitTestSupport.np2EigenVectorXd(rN)
/home/runner/work/bsk_rl/bsk_rl/src/bsk_rl/sim/dyn/base.py:336: BSKDeprecationWarning: Basilisk.utilities.unitTestSupport.np2EigenVectorXd will be removed after 2027-06-23: Use simHelpers.np2EigenVectorXd instead.
self.scObject.hub.v_CN_NInit = unitTestSupport.np2EigenVectorXd(vN)
/home/runner/work/bsk_rl/bsk_rl/src/bsk_rl/sim/dyn/base.py:701: BSKDeprecationWarning: Basilisk.utilities.unitTestSupport.np2EigenVectorXd will be removed after 2027-06-23: Use simHelpers.np2EigenVectorXd instead.
unitTestSupport.np2EigenVectorXd(nHat_B),
2026-07-18 03:50:32,604 sats.satellite.EO-1 INFO <0.00> EO-1: Finding opportunity windows from 0.00 to 600.00 seconds
2026-07-18 03:50:32,644 sats.satellite.EO-2 INFO <0.00> EO-2: Finding opportunity windows from 0.00 to 600.00 seconds
2026-07-18 03:50:32,682 gym INFO <0.00> Environment reset
In the first step, both agents are tasked with an imaging action, and one successfully images a target.
[5]:
_ = env.step({"EO-1": ACTION_IMAGE_3, "EO-2": ACTION_IMAGE_2})
2026-07-18 03:50:32,688 gym INFO <0.00> === STARTING STEP ===
2026-07-18 03:50:32,689 sats.satellite.EO-1 INFO <0.00> EO-1: target index 3 tasked
2026-07-18 03:50:32,689 sats.satellite.EO-1 INFO <0.00> EO-1: Target(tgt-771) tasked for imaging
2026-07-18 03:50:32,690 sats.satellite.EO-1 INFO <0.00> EO-1: Target(tgt-771) window enabled: 0.0 to 190.0
2026-07-18 03:50:32,691 sats.satellite.EO-1 INFO <0.00> EO-1: setting timed terminal event at 190.0
2026-07-18 03:50:32,693 sats.satellite.EO-2 INFO <0.00> EO-2: target index 2 tasked
2026-07-18 03:50:32,693 sats.satellite.EO-2 INFO <0.00> EO-2: Target(tgt-771) tasked for imaging
2026-07-18 03:50:32,694 sats.satellite.EO-2 INFO <0.00> EO-2: Target(tgt-771) window enabled: 0.0 to 101.1
2026-07-18 03:50:32,695 sats.satellite.EO-2 INFO <0.00> EO-2: setting timed terminal event at 101.1
2026-07-18 03:50:32,713 sats.satellite.EO-2 INFO <82.00> EO-2: imaged Target(tgt-771)
2026-07-18 03:50:32,714 data.base INFO <82.00> Total reward: {'EO-2': 0.7368937400599813}
2026-07-18 03:50:32,715 sats.satellite.EO-2 INFO <82.00> EO-2: Satellite EO-2 requires retasking
2026-07-18 03:50:32,718 gym INFO <82.00> Step reward: {'EO-2': 0.7368937400599813}
When both select the broadcast action, data is shared in both directions. This is subject to line-of-sight availability as well as selecting the correct action.
[6]:
_ = env.step({"EO-1": ACTION_BROADCAST, "EO-2": ACTION_BROADCAST})
2026-07-18 03:50:32,723 gym INFO <82.00> === STARTING STEP ===
2026-07-18 03:50:32,724 sats.satellite.EO-1 INFO <82.00> EO-1: setting timed terminal event at 97.0
2026-07-18 03:50:32,725 sats.satellite.EO-2 INFO <82.00> EO-2: setting timed terminal event at 97.0
2026-07-18 03:50:32,727 sats.satellite.EO-1 INFO <83.00> EO-1: imaged Target(tgt-771)
2026-07-18 03:50:32,727 data.base INFO <83.00> Total reward: {}
2026-07-18 03:50:32,728 comm.communication INFO <83.00> Communicating data in 2 directions.
2026-07-18 03:50:32,729 comm.communication INFO <83.00> Optimizing data communication between all pairs of satellites
2026-07-18 03:50:32,730 sats.satellite.EO-1 INFO <83.00> EO-1: Satellite EO-1 requires retasking
2026-07-18 03:50:32,733 gym INFO <83.00> Step reward: {}
One agent can broadcast while the others are completing a different task.
[7]:
_ = env.step({"EO-1": ACTION_IMAGE_2, "EO-2": ACTION_BROADCAST}) # Agent 1 broadcasts
2026-07-18 03:50:32,738 gym INFO <83.00> === STARTING STEP ===
2026-07-18 03:50:32,739 sats.satellite.EO-1 INFO <83.00> EO-1: target index 2 tasked
2026-07-18 03:50:32,739 sats.satellite.EO-1 INFO <83.00> EO-1: Target(tgt-868) tasked for imaging
2026-07-18 03:50:32,741 sats.satellite.EO-1 INFO <83.00> EO-1: Target(tgt-868) window enabled: 141.0 to 338.3
2026-07-18 03:50:32,741 sats.satellite.EO-1 INFO <83.00> EO-1: setting timed terminal event at 338.3
2026-07-18 03:50:32,742 sats.satellite.EO-2 INFO <83.00> EO-2: setting timed terminal event at 98.0
2026-07-18 03:50:32,747 sats.satellite.EO-2 INFO <98.00> EO-2: timed termination at 98.0 for broadcast
2026-07-18 03:50:32,748 data.base INFO <98.00> Total reward: {}
2026-07-18 03:50:32,749 comm.communication INFO <98.00> Communicating data in 1 direction.
2026-07-18 03:50:32,749 sats.satellite.EO-2 INFO <98.00> EO-2: Satellite EO-2 requires retasking
2026-07-18 03:50:32,752 gym INFO <98.00> Step reward: {}