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

Method set_camera_pose

scripts/sim/ue_bridge.py:93–107  ·  view source on GitHub ↗

Set camera position

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

Source from the content-addressed store, hash-verified

91 exit()
92
93 def set_camera_pose(self, x, y, z, pitch, yaw, roll):
94 '''Set camera position'''
95 x = x * 100
96 y = - y * 100
97 z = z * 100
98 camera_settings = {
99 'location': {'x': x, 'y': y, 'z': z},
100 'rotation': {'pitch': pitch, 'yaw': -yaw, 'roll': roll}
101 }
102
103 self._client.request('vset /camera/0/location {x} {y} {z}'.format(**camera_settings['location']))
104 self._client.request('vset /camera/1/location {x} {y} {z}'.format(**camera_settings['location']))
105 self._client.request('vset /camera/0/rotation {pitch} {yaw} {roll}'.format(**camera_settings['rotation']))
106 self._client.request('vset /camera/1/rotation {pitch} {yaw} {roll}'.format(**camera_settings['rotation']))
107 print('camera_settings', camera_settings)
108
109 def _camera_init(self):
110 '''Camera initialization'''

Callers 2

_camera_initMethod · 0.95
handle_plannerFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected