Test branch (#5)

* update for hardware test

* update activate sport_mode
This commit is contained in:
Liao Dengting 2024-03-10 22:32:40 +08:00 committed by GitHub
parent c7e01dcc84
commit 87fd7cdf94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 5 deletions

View File

@ -363,21 +363,25 @@ void Custom::LowCmdWrite(){
sleep(0.5);
while (true)
{
sleep(0.5);
{ // 初始化button值防止damping被误触发
key.components.A = 0;
key.components.B = 0;
key.components.L2 = 0;
sleep(0.2);
if ((int)key.components.B==1 && (int)key.components.L2==1) // [L2+B] is pressed again
{
exit(0);
}else if ((int)key.components.A==1 && (int)key.components.L2==1)
{
std::cout << "======= activate sport_mode service ========"<<std::endl;
rsc.ServiceSwitch("sport_mode", 1);
sleep(1);
std::cout << "======= activate sport_mode service ========"<<std::endl;
sleep(0.5);
exit(0);
}else
{ std::cout << "======= Press [L2+B] again to exit ========"<<std::endl;
std::cout << "======= If the robot is set to nominal pose manually, Press [L2+A] to activate sport_mode service ========"<<std::endl;
continue;
sleep(0.5);
}
}