I'm trying to use torque and braking to control the vehicle but the error "wb_motor_set_force() called with an invalid 'force' argument (NaN)." keeps appearing. Here are the code used:
Initialization
driver_->setGear(1);
driver_->step();
driver_->step();
driver_->step();
simulTime_ = 30;
breaking_ = false;
throttle_ = 0;
breaking_ = 0;
Control application
if(type_ == BREAK){
if(!type_){
type_ = true;
driver_->setThrottle(0);
}
driver_->setBrakeIntensity(breaking_);
}
else if(type_ == ACCELERATE){
if(type_){
type_ = false;
driver_->setBrakeIntensity(0);
}
driver_->setThrottle(throttle_);
}
driver_->setSteeringAngle(phi_);
driver_->step();
simulTime_ += simulStep_;
Thanks!