-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClawIO.cpp
More file actions
30 lines (23 loc) · 914 Bytes
/
ClawIO.cpp
File metadata and controls
30 lines (23 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "io/ClawIO.h"
void ClawIO::Periodic() {
// Process all the inputs and outputs to/from high level software.
VOKC_CALL(ProcessIO());
}
void ClawIO::SimulationPeriodic() {
// SimulationPeriodic
}
bool ClawIO::ProcessIO() {
OKC_CHECK(sw_interface_ != nullptr);
OKC_CHECK(hw_interface_ != nullptr);
OKC_CHECK(hw_interface_->claw_open_and_close_encoder != nullptr);
// Set the software outputs
// If the encoder should be reset, reset it
if (sw_interface_->reset_claw_open_and_close) {
hw_interface_->claw_open_and_close_encoder->SetPosition (0);
// Lower the encoder reset flag
sw_interface_->reset_claw_open_and_close = false;
}
hw_interface_->claw_open_and_close_motor->Set(sw_interface_->claw_open_and_close_power);
sw_interface_->encoder_reading = hw_interface_->claw_open_and_close_encoder->GetPosition();
return true;
}