Compile Error, missing powertrainA

29 views
Skip to first unread message

J D

unread,
Aug 22, 2023, 1:47:51 AM8/22/23
to ProjectChrono
Hi all,

I'm *very* new to this, but noticed on my build that I was having an error in ChronoEngine_vehicle_irrlicht that couldn't find a reference to "PowertrainA"

In this file: C:\workspace\chrono\src\chrono_vehicle\ChVehicleVisualSystemIrrlicht.cpp
At lines 209 and 211 - connected with the Irrklang module.

I don't know enough about Github to submit a commit/suggestion.

I believe GetPowerTrainAssembly() is what was supposed to be called?

------------------------------------------------------


#ifdef CHRONO_IRRKLANG
    static int stepsbetweensound = 0;

    // Update sound pitch
    if (m_car_sound && m_vehicle->GetPowertrainA()) {
        stepsbetweensound++;
        double engine_rpm = m_vehicle->GetPowertrainA()->GetEngine()->GetMotorSpeed() * 60 / CH_C_2PI;
        double soundspeed = engine_rpm / (4000.);  // denominator: to guess
        if (soundspeed < 0.1)
            soundspeed = 0.1;
        if (stepsbetweensound > 20) {
            stepsbetweensound = 0;
            if (m_car_sound->getIsPaused())
                m_car_sound->setIsPaused(false);
            m_car_sound->setPlaybackSpeed((irrklang::ik_f32)soundspeed);
        }
    }
#endif
}

Radu Serban

unread,
Aug 27, 2023, 1:21:29 PM8/27/23
to ProjectChrono

Hi JD,

 

You are correct, that was left over code from a while ago that had not been properly updated (because we usually do not enable use of the Irrklang library). I pushed a fix.

 

Thanks for pointing this out.

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/14b41343-4330-4604-a20d-ae97b7b4ddb1n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages