MCPcopy Create free account
hub / github.com/SHAILAB-IPEC/OpenFly-Platform / set_camera_pose

Method set_camera_pose

train/eval.py:216–230  ·  view source on GitHub ↗

Set camera position

(self, x, y, z, pitch, yaw, roll)

Source from the content-addressed store, hash-verified

214 exit()
215
216 def set_camera_pose(self, x, y, z, pitch, yaw, roll):
217 '''Set camera position'''
218 x = x * 100
219 y = - y * 100
220 z = z * 100
221 camera_settings = {
222 'location': {'x': x, 'y': y, 'z': z},
223 'rotation': {'pitch': pitch, 'yaw': -yaw, 'roll': roll}
224 }
225
226 self._client.request('vset /camera/0/location {x} {y} {z}'.format(**camera_settings['location']))
227 self._client.request('vset /camera/1/location {x} {y} {z}'.format(**camera_settings['location']))
228 self._client.request('vset /camera/0/rotation {pitch} {yaw} {roll}'.format(**camera_settings['rotation']))
229 self._client.request('vset /camera/1/rotation {pitch} {yaw} {roll}'.format(**camera_settings['rotation']))
230 print('camera_settings', camera_settings)
231
232 def _camera_init(self):
233 '''Camera initialization'''

Callers 1

_camera_initMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected