Skip to content

Commit 63f4ae4

Browse files
committed
Fix issues with docs, deployment and testing
1 parent 5d1d942 commit 63f4ae4

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed
File renamed without changes.

.github/workflows/testing.yml

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ jobs:
1414
architecture: 'x64'
1515
- name: Install dependencies
1616
run: pip install .
17+
- name: Install cffirmware
18+
run: |
19+
git clone -b drone_racing https://github.com/utiasDSL/pycffirmware.git
20+
cd pycffirmware
21+
git submodule update --init --recursive
22+
./wrapper/build_linux.sh
1723
- name: Test with pytest
1824
run: |
1925
pip install pytest pytest-cov

lsy_drone_racing/envs/drone_racing_deploy_env.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ def step(
227227
ensures that the environment is running at the correct frequency during deployment.
228228
"""
229229
tstart = time.perf_counter()
230-
collective_thrust, rpy = action
230+
assert action.shape == self.action_space.shape, f"Invalid action shape: {action.shape}"
231+
collective_thrust, rpy = action[0], action[1:]
231232
rpy_deg = np.rad2deg(rpy)
232233
self.cf.cmdVel(*rpy_deg, collective_thrust)
233234
if (dt := time.perf_counter() - tstart) < 1 / self.config.env.freq:

lsy_drone_racing/envs/drone_racing_env.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ def __init__(self, config: dict):
315315
def step(
316316
self, action: NDArray[np.floating]
317317
) -> tuple[dict[str, NDArray[np.floating]], float, bool, bool, dict]:
318-
"""Step the drone racing environment with a thrust command.
318+
"""Step the drone racing environment with a thrust and attitude command.
319319
320320
Args:
321-
action: Thrust command [roll, pitch, yaw, thrust].
321+
action: Thrust command [thrust, roll, pitch, yaw].
322322
"""
323323
assert action.shape == self.action_space.shape, f"Invalid action shape: {action.shape}"
324324
action = action.astype(np.float64)

0 commit comments

Comments
 (0)