Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

One environment, multiple kinds of vehicles. #2990

Closed
sandyUni opened this issue Aug 29, 2020 · 2 comments · May be fixed by #4340
Closed

One environment, multiple kinds of vehicles. #2990

sandyUni opened this issue Aug 29, 2020 · 2 comments · May be fixed by #4340

Comments

@sandyUni
Copy link

I am reading the source code of Airsim to add relative ranging sensor (link). After reading the official manual, I thought Airsim supports multiple vehicles well. However, as I dive into the source code and the mechanism of supporting multiple vehicles of Airsim, I found it does not have a game mode that can make the car and quadrotor coexisted.

Since UE4 has a built-in physic model for groud car, Airsim make different game mode for car and quadrotor in ASimHUD::createSimMode: (in repo)

void ASimHUD::createSimMode()
{
    std::string simmode_name = AirSimSettings::singleton().simmode_name;

    FActorSpawnParameters simmode_spawn_params;
    simmode_spawn_params.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;

    //spawn at origin. We will use this to do global NED transforms, for ex, non-vehicle objects in environment
    if (simmode_name == "Multirotor")
        simmode_ = this->GetWorld()->SpawnActor<ASimModeWorldMultiRotor>(FVector::ZeroVector, 
            FRotator::ZeroRotator, simmode_spawn_params);
    else if (simmode_name == "Car")
        simmode_ = this->GetWorld()->SpawnActor<ASimModeCar>(FVector::ZeroVector,
            FRotator::ZeroRotator, simmode_spawn_params);
    else if (simmode_name == "ComputerVision")
        simmode_ = this->GetWorld()->SpawnActor<ASimModeComputerVision>(FVector::ZeroVector,
            FRotator::ZeroRotator, simmode_spawn_params);
    else {
        UAirBlueprintLib::ShowMessage(EAppMsgType::Ok, std::string("SimMode is not valid: ") + simmode_name, "Error");
        UAirBlueprintLib::LogMessageString("SimMode is not valid: ", simmode_name, LogDebugLevel::Failure);
    }
}

This above code only runs one time at each simulation, therefore car and quadrotor or any other kinds of game mode can not coexist. This issue greatly limits its application scenarios such as groud-air cooperative tracking.

Is there any plan for supporting different kinds of vehicles?

@jonyMarino
Copy link
Collaborator

jonyMarino commented Sep 2, 2020

duplicate of #506 ?

@sandyUni
Copy link
Author

yes, it is a duplication of #506

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants