mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
Improve const correctness.
See https://usfirst.collab.net/sf/tracker/do/viewArtifact/projects.wpilib/tracker.4_defects/artf4148 Change-Id: I47b0d5a91fd49e47e2c7348b0705e998ec815682
This commit is contained in:
@@ -72,7 +72,7 @@ void Servo::SetOffline() {
|
||||
*
|
||||
* @return Position from 0.0 to 1.0.
|
||||
*/
|
||||
float Servo::Get()
|
||||
float Servo::Get() const
|
||||
{
|
||||
return GetPosition();
|
||||
}
|
||||
@@ -108,7 +108,7 @@ void Servo::SetAngle(float degrees)
|
||||
* Assume that the servo angle is linear with respect to the PWM value (big assumption, need to test).
|
||||
* @return The angle in degrees to which the servo is set.
|
||||
*/
|
||||
float Servo::GetAngle()
|
||||
float Servo::GetAngle() const
|
||||
{
|
||||
return (float)GetPosition() * GetServoAngleRange() + kMinServoAngle;
|
||||
}
|
||||
@@ -135,7 +135,7 @@ void Servo::StopLiveWindowMode() {
|
||||
}
|
||||
}
|
||||
|
||||
std::string Servo::GetSmartDashboardType() {
|
||||
std::string Servo::GetSmartDashboardType() const {
|
||||
return "Servo";
|
||||
}
|
||||
|
||||
@@ -144,6 +144,6 @@ void Servo::InitTable(ITable *subTable) {
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
ITable * Servo::GetTable() {
|
||||
ITable * Servo::GetTable() const {
|
||||
return m_table;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user