Set camera position
(self, x, y, z, pitch, yaw, roll)
| 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''' |