This class contains an atomic timeout behavior. It uses the CARLA game time, not the system time which is used by the py_trees timer.
| 131 | |
| 132 | |
| 133 | class TimeOut(SimulationTimeCondition): |
| 134 | |
| 135 | """ |
| 136 | This class contains an atomic timeout behavior. |
| 137 | It uses the CARLA game time, not the system time which is used by |
| 138 | the py_trees timer. |
| 139 | """ |
| 140 | |
| 141 | def __init__(self, timeout, name="TimeOut"): |
| 142 | """ |
| 143 | Setup timeout |
| 144 | """ |
| 145 | super(TimeOut, self).__init__(timeout, name=name) |
| 146 | self.timeout = False |
| 147 | |
| 148 | def update(self): |
| 149 | """ |
| 150 | Upon reaching the timeout value the status changes to SUCCESS |
| 151 | """ |
| 152 | |
| 153 | new_status = super(TimeOut, self).update() |
| 154 | |
| 155 | if new_status == py_trees.common.Status.SUCCESS: |
| 156 | self.timeout = True |
| 157 | |
| 158 | return new_status |
no outgoing calls
no test coverage detected