|
70 | 70 | " \"quaternion_adjugate\",\n",
|
71 | 71 | " \"rotation_6d\",\n",
|
72 | 72 | " \"rotation_10d\",\n",
|
| 73 | + " \"so3_log_map\",\n", |
73 | 74 | "]"
|
74 | 75 | ]
|
75 | 76 | },
|
|
189 | 190 | " euler_angles_to_matrix,\n",
|
190 | 191 | " quaternion_to_matrix,\n",
|
191 | 192 | " rotation_6d_to_matrix,\n",
|
| 193 | + " so3_exp_map,\n", |
192 | 194 | ")\n",
|
193 | 195 | "\n",
|
194 | 196 | "\n",
|
195 |
| - "def _convert_to_rotation_matrix(rotation, parameterization, convention):\n", |
| 197 | + "def _convert_to_rotation_matrix(rotation, parameterization, convention, **kwargs):\n", |
196 | 198 | " \"\"\"Convert any parameterization of a rotation to a matrix representation.\"\"\"\n",
|
197 | 199 | " if parameterization == \"axis_angle\":\n",
|
198 | 200 | " R = axis_angle_to_matrix(rotation)\n",
|
|
208 | 210 | " R = quaternion_to_matrix(rotation_10d_to_quaternion(rotation))\n",
|
209 | 211 | " elif parameterization == \"quaternion_adjugate\":\n",
|
210 | 212 | " R = quaternion_to_matrix(quaternion_adjugate_to_quaternion(rotation))\n",
|
| 213 | + " elif parameterization == \"so3_log_map\":\n", |
| 214 | + " R = so3_exp_map(R, **kwargs)\n", |
211 | 215 | " else:\n",
|
212 | 216 | " raise ValueError(\n",
|
213 | 217 | " f\"parameterization must be in {PARAMETERIZATIONS}, not {parameterization}\"\n",
|
|
228 | 232 | " matrix_to_euler_angles,\n",
|
229 | 233 | " matrix_to_quaternion,\n",
|
230 | 234 | " matrix_to_rotation_6d,\n",
|
| 235 | + " so3_log_map,\n", |
231 | 236 | ")\n",
|
232 | 237 | "\n",
|
233 | 238 | "\n",
|
234 |
| - "def _convert_from_rotation_matrix(matrix, parameterization, convention=None):\n", |
| 239 | + "def _convert_from_rotation_matrix(matrix, parameterization, convention=None, **kwargs):\n", |
235 | 240 | " \"Convert a rotation matrix to any allowed parameterization.\"\n",
|
236 | 241 | " if parameterization == \"axis_angle\":\n",
|
237 | 242 | " rotation = matrix_to_axis_angle(matrix)\n",
|
|
249 | 254 | " elif parameterization == \"quaternion_adjugate\":\n",
|
250 | 255 | " q = _convert_from_rotation_matrix(matrix, \"quaternion\")\n",
|
251 | 256 | " rotation = quaternion_to_quaternion_adjugate(q)\n",
|
| 257 | + " elif parameterization == \"so3_log_map\":\n", |
| 258 | + " rotation = so3_log_map(R, **kwargs)\n", |
252 | 259 | " else:\n",
|
253 | 260 | " raise ValueError(\n",
|
254 | 261 | " f\"parameterization must be in {PARAMETERIZATIONS}, not {parameterization}\"\n",
|
|
0 commit comments