@@ -269,13 +269,90 @@ __pragma(warning(disable : 4239))
269
269
vector<uint8_t > RpcLibClientBase::simGetImage (const std::string& camera_name, ImageCaptureBase::ImageType type, const std::string& vehicle_name, bool external)
270
270
{
271
271
vector<uint8_t > result = pimpl_->client .call (" simGetImage" , camera_name, type, vehicle_name, external).as <vector<uint8_t >>();
272
- if (result.size () == 1 ) {
273
- // rpclib has a bug with serializing empty vectors, so we return a 1 byte vector instead.
274
- result.clear ();
275
- }
276
272
return result;
277
273
}
278
274
275
+ // CinemAirSim
276
+ std::vector<std::string> RpcLibClientBase::simGetPresetLensSettings (const std::string& camera_name, const std::string& vehicle_name, bool external)
277
+ {
278
+ return pimpl_->client .call (" simGetPresetLensSettings" , camera_name, vehicle_name, external).as <vector<std::string>>();
279
+ }
280
+
281
+ std::string RpcLibClientBase::simGetLensSettings (const std::string& camera_name, const std::string& vehicle_name, bool external)
282
+ {
283
+ return pimpl_->client .call (" simGetLensSettings" , camera_name, vehicle_name, external).as <std::string>();
284
+ }
285
+
286
+ void RpcLibClientBase::simSetPresetLensSettings (const std::string& preset_lens_settings, const std::string& camera_name, const std::string& vehicle_name, bool external)
287
+ {
288
+ pimpl_->client .call (" simSetPresetLensSettings" , preset_lens_settings, camera_name, vehicle_name, external);
289
+ }
290
+
291
+ std::vector<std::string> RpcLibClientBase::simGetPresetFilmbackSettings (const std::string& camera_name, const std::string& vehicle_name, bool external)
292
+ {
293
+ return pimpl_->client .call (" simGetPresetFilmbackSettings" , camera_name, vehicle_name, external).as <vector<std::string>>();
294
+ }
295
+
296
+ void RpcLibClientBase::simSetPresetFilmbackSettings (const std::string& preset_filmback_settings, const std::string& camera_name, const std::string& vehicle_name, bool external)
297
+ {
298
+ pimpl_->client .call (" simSetPresetFilmbackSettings" , preset_filmback_settings, camera_name, vehicle_name, external);
299
+ }
300
+
301
+ std::string RpcLibClientBase::simGetFilmbackSettings (const std::string& camera_name, const std::string& vehicle_name, bool external)
302
+ {
303
+ return pimpl_->client .call (" simGetFilmbackSettings" , camera_name, vehicle_name, external).as <std::string>();
304
+ }
305
+
306
+ float RpcLibClientBase::simSetFilmbackSettings (const float sensor_width, const float sensor_height, const std::string& camera_name, const std::string& vehicle_name, bool external)
307
+ {
308
+ return pimpl_->client .call (" simSetFilmbackSettings" , sensor_width, sensor_height, camera_name, vehicle_name, external).as <float >();
309
+ }
310
+
311
+ float RpcLibClientBase::simGetFocalLength (const std::string& camera_name, const std::string& vehicle_name, bool external)
312
+ {
313
+ return pimpl_->client .call (" simGetFocalLength" , camera_name, vehicle_name, external).as <float >();
314
+ }
315
+
316
+ void RpcLibClientBase::simSetFocalLength (const float focal_length, const std::string& camera_name, const std::string& vehicle_name, bool external)
317
+ {
318
+ pimpl_->client .call (" simSetFocalLength" , focal_length, camera_name, vehicle_name, external);
319
+ }
320
+
321
+ void RpcLibClientBase::simEnableManualFocus (const bool enable, const std::string& camera_name, const std::string& vehicle_name, bool external)
322
+ {
323
+ pimpl_->client .call (" simEnableManualFocus" , enable, camera_name, vehicle_name, external);
324
+ }
325
+
326
+ float RpcLibClientBase::simGetFocusDistance (const std::string& camera_name, const std::string& vehicle_name, bool external)
327
+ {
328
+ return pimpl_->client .call (" simGetFocusDistance" , camera_name, vehicle_name, external).as <float >();
329
+ }
330
+ void RpcLibClientBase::simSetFocusDistance (const float focus_distance, const std::string& camera_name, const std::string& vehicle_name, bool external)
331
+ {
332
+ pimpl_->client .call (" simSetFocusDistance" , focus_distance, camera_name, vehicle_name, external);
333
+ }
334
+
335
+ float RpcLibClientBase::simGetFocusAperture (const std::string& camera_name, const std::string& vehicle_name, bool external)
336
+ {
337
+ return pimpl_->client .call (" simGetFocusAperture" , camera_name, vehicle_name, external).as <float >();
338
+ }
339
+
340
+ void RpcLibClientBase::simSetFocusAperture (const float focus_aperture, const std::string& camera_name, const std::string& vehicle_name, bool external)
341
+ {
342
+ pimpl_->client .call (" simSetFocusAperture" , focus_aperture, camera_name, vehicle_name, external);
343
+ }
344
+
345
+ void RpcLibClientBase::simEnableFocusPlane (const bool enable, const std::string& camera_name, const std::string& vehicle_name, bool external)
346
+ {
347
+ pimpl_->client .call (" simEnableFocusPlane" , enable, camera_name, vehicle_name, external);
348
+ }
349
+
350
+ std::string RpcLibClientBase::simGetCurrentFieldOfView (const std::string& camera_name, const std::string& vehicle_name, bool external)
351
+ {
352
+ return pimpl_->client .call (" simGetCurrentFieldOfView" , camera_name, vehicle_name, external).as <std::string>();
353
+ }
354
+ // End CinemAirSim
355
+
279
356
// Minor TODO: consider msgpack magic for GeoPoint, so we can have one arg instead of three
280
357
bool RpcLibClientBase::simTestLineOfSightToPoint (const msr::airlib::GeoPoint& point, const std::string& vehicle_name)
281
358
{
0 commit comments