fix something

This commit is contained in:
fan-ziqi 2024-03-29 22:29:28 +08:00
parent 41b4672d75
commit 33c618b88e
5 changed files with 34 additions and 11 deletions

View File

@ -104,7 +104,6 @@ rosrun rl_sar rl_real
ping 192.168.55.100 #本地PC被分配的ip
ssh mi@192.168.55.1 #登录nx应用板 ,密码123
athena_version -v #核对当前版本>=1.0.0.94
ssh root@192.168.55.233 #登录运动控制板
```
2. 进入电机控制模式
@ -138,6 +137,17 @@ rosrun rl_sar rl_real
```
按下键盘上的**0**键让机器人切换到默认站起姿态,按下**P**键切换到RL控制模式任意状态按下**1**键切换到最初的趴下姿态。WS控制xAD控制yawJL控制y。
4. 重启
```bash
# 重启运控程序:
ssh root@192.168.55.233 "ps | grep -E 'Example_MotorCtrl' | grep -v grep | awk '{print \$1}' | xargs kill -9" #需先于主进程暂停,避免急停
ssh root@192.168.55.233 "ps | grep -E 'manager|ctrl|imu_online' | grep -v grep | awk '{print \$1}' | xargs kill -9"
ssh root@192.168.55.233 "export LD_LIBRARY_PATH=/mnt/UDISK/robot-software/build;/mnt/UDISK/manager /mnt/UDISK/ >> /mnt/UDISK/manager_log/manager.log 2>&1 &"
# 重启运控板系统:
ssh root@192.168.55.233 "reboot"
```
lcm通信若不成功无法正常激活电机控制模式log提示Motor control mode has not been activated successfully

View File

@ -19,6 +19,6 @@ target_link_libraries(cyberdog_motor_sdk
lcm
)
## compile use code
#add_executable(Example_MotorCtrl src/Example_MotorCtrl.cpp)
#target_link_libraries(Example_MotorCtrl cyberdog_motor_sdk)
# compile use code
add_executable(Example_MotorCtrl src/Example_MotorCtrl.cpp)
target_link_libraries(Example_MotorCtrl cyberdog_motor_sdk)

View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e
set -u
ifconfig | grep -B 1 192.168.55.100 | grep "flags"| cut -d ':' -f1 #获取该ip对应网络设备一般为usb0
sudo ifconfig usb0 multicast #usb0替换为上文获取的168.55.100对应网络设备,并配为多播
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev usb0 #添加路由表usb0对应替换

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
set -u
ssh root@192.168.55.233 "ps | grep -E 'manager|ctrl|imu_online' | grep -v grep | awk '{print \$1}' | xargs kill -9"
ssh root@192.168.55.233 "export LD_LIBRARY_PATH=/mnt/UDISK/robot-software/build;/mnt/UDISK/manager /mnt/UDISK/ >> /mnt/UDISK/manager_log/manager.log 2>&1 &"

View File

@ -20,8 +20,8 @@ RL_Real::RL_Real() : CustomInterface(500)
this->params.num_observations = 45;
this->params.clip_obs = 100.0;
this->params.clip_actions = 100.0;
this->params.damping = 0.5;
this->params.stiffness = 20;
this->params.damping = 2.0;
this->params.stiffness = 50;
this->params.d_gains = torch::ones(12) * this->params.damping;
this->params.p_gains = torch::ones(12) * this->params.stiffness;
this->params.action_scale = 0.25;
@ -110,8 +110,8 @@ void RL_Real::RobotControl()
{
cyberdogCmd.q_des[i] = (1 - getup_percent) * now_pos[i] + getup_percent * params.default_dof_pos[0][dof_mapping[i]].item<double>();
cyberdogCmd.qd_des[i] = 0;
cyberdogCmd.kp_des[i] = 50;
cyberdogCmd.kd_des[i] = 3;
cyberdogCmd.kp_des[i] = 200;
cyberdogCmd.kd_des[i] = 10;
cyberdogCmd.tau_des[i] = 0;
}
printf("getting up %.3f%%\r", getup_percent*100.0);
@ -178,8 +178,8 @@ void RL_Real::RobotControl()
{
cyberdogCmd.q_des[i] = (1 - getdown_percent) * now_pos[i] + getdown_percent * start_pos[i];
cyberdogCmd.qd_des[i] = 0;
cyberdogCmd.kp_des[i] = 50;
cyberdogCmd.kd_des[i] = 3;
cyberdogCmd.kp_des[i] = 200;
cyberdogCmd.kd_des[i] = 10;
cyberdogCmd.tau_des[i] = 0;
}
printf("getting down %.3f%%\r", getdown_percent*100.0);