feat: don't autograd

This commit is contained in:
fan-ziqi 2024-04-28 20:01:13 +08:00
parent b8b0c066a2
commit 81fa87035a
3 changed files with 6 additions and 0 deletions

View File

@ -9,6 +9,8 @@ RL_Real rl_sar;
RL_Real::RL_Real() : safe(LeggedType::A1), udp(LOWLEVEL) RL_Real::RL_Real() : safe(LeggedType::A1), udp(LOWLEVEL)
{ {
torch::autograd::GradMode::set_enabled(false);
ReadYaml(ROBOT_NAME); ReadYaml(ROBOT_NAME);
udp.InitCmdData(cmd); udp.InitCmdData(cmd);

View File

@ -9,6 +9,8 @@ RL_Real rl_sar;
RL_Real::RL_Real() : CustomInterface(500) RL_Real::RL_Real() : CustomInterface(500)
{ {
torch::autograd::GradMode::set_enabled(false);
ReadYaml(ROBOT_NAME); ReadYaml(ROBOT_NAME);
start_time = std::chrono::high_resolution_clock::now(); start_time = std::chrono::high_resolution_clock::now();

View File

@ -7,6 +7,8 @@
RL_Sim::RL_Sim() RL_Sim::RL_Sim()
{ {
torch::autograd::GradMode::set_enabled(false);
ReadYaml(ROBOT_NAME); ReadYaml(ROBOT_NAME);
// Due to the fact that the robot_state_publisher sorts the joint names alphabetically, // Due to the fact that the robot_state_publisher sorts the joint names alphabetically,