mirror of
https://github.com/westonrobot/ugv_sdk
synced 2023-04-08 06:32:14 +08:00
saved work
This commit is contained in:
@@ -39,9 +39,7 @@ class AgilexBase {
|
||||
virtual void Connect(std::string dev_name) = 0;
|
||||
|
||||
// cmd thread runs at 50Hz (20ms) by default
|
||||
void SetCmdThreadPeriodMs(int32_t period_ms) {
|
||||
cmd_thread_period_ms_ = period_ms;
|
||||
};
|
||||
void SetCmdThreadPeriodMs(int32_t period_ms);
|
||||
|
||||
// timeout: robot stops if user does not call SetMotionCommand() periodically
|
||||
void EnableCmdTimeout(uint32_t timeout_ms = 100);
|
||||
|
||||
@@ -37,6 +37,10 @@ void AgilexBase::Terminate() {
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
void AgilexBase::SetCmdThreadPeriodMs(int32_t period_ms) {
|
||||
cmd_thread_period_ms_ = period_ms;
|
||||
};
|
||||
|
||||
void AgilexBase::EnableCmdTimeout(uint32_t timeout_ms) {
|
||||
enable_timeout_ = true;
|
||||
timeout_ms_ = timeout_ms;
|
||||
@@ -153,15 +157,14 @@ void AgilexBase::DisableLightControl() {
|
||||
can_->SendFrame(frame);
|
||||
}
|
||||
|
||||
void AgilexBase::SetMotionMode(uint8_t mode)
|
||||
{
|
||||
AgxMessage msg;
|
||||
msg.type = AgxMsgSetMotionMode;
|
||||
msg.body.motion_mode_msg.motion_mode = mode;
|
||||
void AgilexBase::SetMotionMode(uint8_t mode) {
|
||||
AgxMessage msg;
|
||||
msg.type = AgxMsgSetMotionMode;
|
||||
msg.body.motion_mode_msg.motion_mode = mode;
|
||||
|
||||
// send to can bus
|
||||
can_frame frame;
|
||||
EncodeCanFrame(&msg, &frame);
|
||||
can_->SendFrame(frame);
|
||||
// send to can bus
|
||||
can_frame frame;
|
||||
EncodeCanFrame(&msg, &frame);
|
||||
can_->SendFrame(frame);
|
||||
}
|
||||
} // namespace westonrobot
|
||||
|
||||
Reference in New Issue
Block a user