From 62a95ed02cde329a8ab644f589cbcc7541a1733c Mon Sep 17 00:00:00 2001 From: fan-ziqi Date: Sat, 30 Mar 2024 19:05:44 +0800 Subject: [PATCH] fix something --- src/rl_sar/include/rl_real_cyberdog.hpp | 1 + src/rl_sar/src/rl_real_cyberdog.cpp | 12 ++++++++---- .../urdf/cyberdog_description.urdf | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/rl_sar/include/rl_real_cyberdog.hpp b/src/rl_sar/include/rl_real_cyberdog.hpp index 038f258..630b195 100644 --- a/src/rl_sar/include/rl_real_cyberdog.hpp +++ b/src/rl_sar/include/rl_real_cyberdog.hpp @@ -10,6 +10,7 @@ // #include #include #include +#include using namespace UNITREE_LEGGED_SDK; diff --git a/src/rl_sar/src/rl_real_cyberdog.cpp b/src/rl_sar/src/rl_real_cyberdog.cpp index 8cadd43..c2ea405 100644 --- a/src/rl_sar/src/rl_real_cyberdog.cpp +++ b/src/rl_sar/src/rl_real_cyberdog.cpp @@ -1,10 +1,10 @@ #include "../include/rl_real_cyberdog.hpp" -// #define PLOT +#define PLOT RL_Real rl_sar; -RL_Real::RL_Real() : CustomInterface(500) +RL_Real::RL_Real() : CustomInterface(5000) { start_time = std::chrono::high_resolution_clock::now(); @@ -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 = 2.0; - this->params.stiffness = 50; + this->params.damping = 1.0; + this->params.stiffness = 30; 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; @@ -70,6 +70,10 @@ RL_Real::~RL_Real() #ifdef PLOT loop_plot->shutdown(); #endif + + system("ssh root@192.168.55.233 \"ps | grep -E 'manager|ctrl|imu_online' | grep -v grep | awk '{print \\$1}' | xargs kill -9\""); + system("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 &\""); + printf("exit\n"); } diff --git a/src/robots/cyberdog_description/urdf/cyberdog_description.urdf b/src/robots/cyberdog_description/urdf/cyberdog_description.urdf index 4d7c2ff..cfa69cb 100644 --- a/src/robots/cyberdog_description/urdf/cyberdog_description.urdf +++ b/src/robots/cyberdog_description/urdf/cyberdog_description.urdf @@ -300,7 +300,7 @@ - +