Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Joystick Wheel Record Data Problem #869

Closed
Yunusbcr opened this issue Mar 8, 2018 · 1 comment
Closed

Joystick Wheel Record Data Problem #869

Yunusbcr opened this issue Mar 8, 2018 · 1 comment

Comments

@Yunusbcr
Copy link

Yunusbcr commented Mar 8, 2018

In CarPawn.cpp

std::string ACarPawn::getLogString()
{
    // Timestamp \t Speed \t Throttle \t Steering \t Brake \t gear

    // timestamp
    uint64_t timestamp_millis = static_cast<uint64_t>(msr::airlib::ClockFactory::get()->nowNanos() / 1.0E6);

    // Speed
    float KPH = FMath::Abs(GetVehicleMovement()->GetForwardSpeed()) * 0.036f;
    int32 KPH_int = FMath::FloorToInt(KPH);

    // Gear
    FString gearString = GearDisplayString.ToString();
    std::string gear = std::string(TCHAR_TO_UTF8(*gearString));

    std::string logString = std::to_string(timestamp_millis).append("\t")
        .append(std::to_string(KPH_int).append("\t"))
        .append(std::to_string(keyboard_controls_.throttle)).append("\t")
        .append(std::to_string(keyboard_controls_.steering)).append("\t")
        .append(std::to_string(keyboard_controls_.brake)).append("\t")
        .append(gear).append("\t");

    return logString;
}

I think keyboard_controls_.* terms should be replaced with current_controls I tried in my local repo but it gives error in build. ( I am using an R/C Remote Controller as a joystick wheel and in airsim_rec.txt there is keyboard record not joystick)

sytelus added a commit that referenced this issue Mar 15, 2018
@sytelus
Copy link
Contributor

sytelus commented Mar 15, 2018

Good catch. Fixed in above commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants