forked from compAIR/libcreate
Add static cast to fix compiler warnings
Signed-off-by: Jacob Perron <jacobmperron@gmail.com>
This commit is contained in:
parent
4d9f0e891a
commit
4e8d497024
1 changed files with 21 additions and 21 deletions
|
@ -370,10 +370,10 @@ namespace create {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t cmd[5] = { OC_DRIVE,
|
uint8_t cmd[5] = { OC_DRIVE,
|
||||||
vel_mm >> 8,
|
static_cast<uint8_t>(vel_mm >> 8),
|
||||||
vel_mm & 0xff,
|
static_cast<uint8_t>(vel_mm & 0xff),
|
||||||
radius_mm >> 8,
|
static_cast<uint8_t>(radius_mm >> 8),
|
||||||
radius_mm & 0xff
|
static_cast<uint8_t>(radius_mm & 0xff)
|
||||||
};
|
};
|
||||||
|
|
||||||
return serial->send(cmd, 5);
|
return serial->send(cmd, 5);
|
||||||
|
@ -389,10 +389,10 @@ namespace create {
|
||||||
int16_t rightCmd = roundf(boundedRightVel * 1000);
|
int16_t rightCmd = roundf(boundedRightVel * 1000);
|
||||||
|
|
||||||
uint8_t cmd[5] = { OC_DRIVE_DIRECT,
|
uint8_t cmd[5] = { OC_DRIVE_DIRECT,
|
||||||
rightCmd >> 8,
|
static_cast<uint8_t>(rightCmd >> 8),
|
||||||
rightCmd & 0xff,
|
static_cast<uint8_t>(rightCmd & 0xff),
|
||||||
leftCmd >> 8,
|
static_cast<uint8_t>(leftCmd >> 8),
|
||||||
leftCmd & 0xff
|
static_cast<uint8_t>(leftCmd & 0xff)
|
||||||
};
|
};
|
||||||
return serial->send(cmd, 5);
|
return serial->send(cmd, 5);
|
||||||
} else {
|
} else {
|
||||||
|
@ -439,11 +439,11 @@ namespace create {
|
||||||
int16_t rightPwm = roundf(rightWheel * PWM_COUNTS);
|
int16_t rightPwm = roundf(rightWheel * PWM_COUNTS);
|
||||||
|
|
||||||
uint8_t cmd[5] = { OC_DRIVE_PWM,
|
uint8_t cmd[5] = { OC_DRIVE_PWM,
|
||||||
rightPwm >> 8,
|
static_cast<uint8_t>(rightPwm >> 8),
|
||||||
rightPwm & 0xff,
|
static_cast<uint8_t>(rightPwm & 0xff),
|
||||||
leftPwm >> 8,
|
static_cast<uint8_t>(leftPwm >> 8),
|
||||||
leftPwm & 0xff
|
static_cast<uint8_t>(leftPwm & 0xff)
|
||||||
};
|
};
|
||||||
|
|
||||||
return serial->send(cmd, 5);
|
return serial->send(cmd, 5);
|
||||||
}
|
}
|
||||||
|
@ -466,10 +466,10 @@ namespace create {
|
||||||
vacuumMotorPower = roundf(vacuum * 127);
|
vacuumMotorPower = roundf(vacuum * 127);
|
||||||
|
|
||||||
uint8_t cmd[4] = { OC_MOTORS_PWM,
|
uint8_t cmd[4] = { OC_MOTORS_PWM,
|
||||||
mainMotorPower,
|
mainMotorPower,
|
||||||
sideMotorPower,
|
sideMotorPower,
|
||||||
vacuumMotorPower
|
vacuumMotorPower
|
||||||
};
|
};
|
||||||
|
|
||||||
return serial->send(cmd, 4);
|
return serial->send(cmd, 4);
|
||||||
}
|
}
|
||||||
|
@ -489,10 +489,10 @@ namespace create {
|
||||||
bool Create::updateLEDs() {
|
bool Create::updateLEDs() {
|
||||||
uint8_t LEDByte = debrisLED + spotLED + dockLED + checkLED;
|
uint8_t LEDByte = debrisLED + spotLED + dockLED + checkLED;
|
||||||
uint8_t cmd[4] = { OC_LEDS,
|
uint8_t cmd[4] = { OC_LEDS,
|
||||||
LEDByte,
|
LEDByte,
|
||||||
powerLED,
|
powerLED,
|
||||||
powerLEDIntensity
|
powerLEDIntensity
|
||||||
};
|
};
|
||||||
|
|
||||||
return serial->send(cmd, 4);
|
return serial->send(cmd, 4);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue