AVSLab / bsk_rl

RL environments and tools for spacecraft autonomy research, built on Basilisk. Developed by the AVS Lab.
https://avslab.github.io/bsk_rl/
MIT License
39 stars 4 forks source link

Requires retasking should consider the environment's maximum step duration #125

Open LorenzzoQM opened 6 months ago

LorenzzoQM commented 6 months ago

Describe the bug Info for "requires_retasking" does not consider the maximum step duration of the environment to specify if the satellite needs retasking.

Expected behavior The satellite should require retasking if the time elapsed from the last tasking was more than the environment's maximum step duration.

Version:

Mark2000 commented 2 months ago

I'm going to take a look at this since I was likewise running into this issue. My thought is to add a flag (either to the satellite or the environment) to say whether the environment timeout should require retaking. Something like require_retasking_on_max_step?

At the same time, I'll address a related issue, which is that an event that is the same duration as max_step_duration will cause the env to stop and return requires_retasking=False, followed by a zero-duration step that returns requires_retasking=True. This is weird and potentially bad for obvious reasons.

Mark2000 commented 2 months ago

For the latter comment I made, it seems that this is because BSK makes sure that events aren't checked twice for one time. For example, if an event triggers at 10 seconds and you run the sim for 10 seconds, then 5 more second, the event will trigger only once at the beginning of the 5 second execution and not at the end of the 10 second execution.