-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code about spawning world and robot (#10)
* Temporary push, moving code from Pegasus to StrideSim * success spawning anymal C * fix superfluous-parens * Update exts/stride.simulator/stride/simulator/interfaces/stride_sim_interface.py Co-authored-by: brewmaster <[email protected]> * revise code from comments * revise code from comments & change words pegasus to stride * resolve pylint syntax error * resolve codes from all conversataions * check pylint syntax --------- Co-authored-by: brewmaster <[email protected]>
- Loading branch information
1 parent
56a9635
commit ecbff6d
Showing
14 changed files
with
1,039 additions
and
17 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# blank |
Empty file.
23 changes: 22 additions & 1 deletion
23
exts/stride.simulator/stride/simulator/common/coordinate_system.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
"""PlACEHOLDER""" | ||
import numpy as np | ||
from scipy.spatial.transform import Rotation | ||
|
||
# Quaternion for rotation between ENU and NED INERTIAL frames | ||
# NED to ENU: +PI/2 rotation about Z (Down) followed by a +PI rotation around X (old North/new East) | ||
# ENU to NED: +PI/2 rotation about Z (Up) followed by a +PI rotation about X (old East/new North) | ||
# This rotation is symmetric, so q_ENU_to_NED == q_NED_to_ENU. | ||
# Note: this quaternion follows the convention [qx, qy, qz, qw] | ||
q_ENU_to_NED = np.array([0.70711, 0.70711, 0.0, 0.0]) | ||
|
||
# A scipy rotation from the ENU inertial frame to the NED inertial frame of reference | ||
rot_ENU_to_NED = Rotation.from_quat(q_ENU_to_NED) | ||
|
||
# Quaternion for rotation between body FLU and body FRD frames | ||
# +PI rotation around X (Forward) axis rotates from Forward, Right, Down (aircraft) | ||
# to Forward, Left, Up (base_link) frames and vice-versa. | ||
# This rotation is symmetric, so q_FLU_to_FRD == q_FRD_to_FLU. | ||
# Note: this quaternion follows the convention [qx, qy, qz, qw] | ||
q_FLU_to_FRD = np.array([1.0, 0.0, 0.0, 0.0]) | ||
|
||
# A scipe rotation from the FLU body frame to the FRD body frame | ||
rot_FLU_to_FRD = Rotation.from_quat(q_FLU_to_FRD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.