Skip to content

Commit

Permalink
More warnings, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rajat2004 committed Feb 13, 2021
1 parent 7304f21 commit 59e39f2
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions Unreal/Plugins/AirSim/Source/WorldSimApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,11 @@ void WorldSimApi::setWind(const Vector3r& wind) const
simmode_->setWind(wind);
}

CameraInfo WorldSimApi::getCameraInfo(const std::string& camera_name, const std::string& vehicle_name, bool external) const
msr::airlib::CameraInfo WorldSimApi::getCameraInfo(const std::string& camera_name, const std::string& vehicle_name, bool external) const
{
CameraInfo info;
UAirBlueprintLib::RunCommandOnGameThread([this, &camera_name, &vehicle_name, &external, &info]() {
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
msr::airlib::CameraInfo info;
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
UAirBlueprintLib::RunCommandOnGameThread([camera, &info]() {
info = camera->getCameraInfo();
}, true);

Expand All @@ -578,36 +578,35 @@ CameraInfo WorldSimApi::getCameraInfo(const std::string& camera_name, const std:
void WorldSimApi::setCameraPose(const std::string& camera_name, const msr::airlib::Pose& pose,
const std::string& vehicle_name, bool external)
{
UAirBlueprintLib::RunCommandOnGameThread([this, &camera_name, &vehicle_name, &external, &pose]() {
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
UAirBlueprintLib::RunCommandOnGameThread([camera, &pose]() {
camera->setCameraPose(pose);
}, true);
}

void WorldSimApi::setCameraFoV(const std::string& camera_name, float fov_degrees,
const std::string& vehicle_name, bool external)
{
UAirBlueprintLib::RunCommandOnGameThread([this, &camera_name, &vehicle_name, &external, &fov_degrees]() {
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
UAirBlueprintLib::RunCommandOnGameThread([camera, &fov_degrees]() {
camera->setCameraFoV(fov_degrees);
}, true);
}

void WorldSimApi::setDistortionParam(const std::string& camera_name, const std::string& param_name, float value,
const std::string& vehicle_name, bool external)
{
UAirBlueprintLib::RunCommandOnGameThread([this, &camera_name, &vehicle_name, &external,
&param_name, &value]() {
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
UAirBlueprintLib::RunCommandOnGameThread([camera, &param_name, &value]() {
camera->setDistortionParam(param_name, value);
}, true);
}

std::vector<float> WorldSimApi::getDistortionParams(const std::string& camera_name, const std::string& vehicle_name, bool external) const
{
std::vector<float> param_values;
UAirBlueprintLib::RunCommandOnGameThread([this, &camera_name, &vehicle_name, &external, &param_values]() {
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
auto camera = simmode_->getCamera(camera_name, vehicle_name, external);
UAirBlueprintLib::RunCommandOnGameThread([camera, &param_values]() {
param_values = camera->getDistortionParams();
}, true);

Expand Down

0 comments on commit 59e39f2

Please sign in to comment.