diff --git a/src/rl_sar/src/rl_real_a1.cpp b/src/rl_sar/src/rl_real_a1.cpp index 6d6c57e..c3c4429 100644 --- a/src/rl_sar/src/rl_real_a1.cpp +++ b/src/rl_sar/src/rl_real_a1.cpp @@ -21,6 +21,7 @@ RL_Real::RL_Real() : unitree_safe(UNITREE_LEGGED_SDK::LeggedType::A1), unitree_u this->InitObservations(); this->InitOutputs(); this->InitControl(); + running_state = STATE_WAITING; // model std::string model_path = std::string(CMAKE_CURRENT_SOURCE_DIR) + "/models/" + this->robot_name + "/" + this->params.model_name; @@ -37,7 +38,7 @@ RL_Real::RL_Real() : unitree_safe(UNITREE_LEGGED_SDK::LeggedType::A1), unitree_u this->loop_keyboard->start(); this->loop_control->start(); this->loop_rl->start(); - + #ifdef PLOT this->plot_t = std::vector(this->plot_size, 0); diff --git a/src/rl_sar/src/rl_sim.cpp b/src/rl_sar/src/rl_sim.cpp index 2b06672..b01ad82 100644 --- a/src/rl_sar/src/rl_sim.cpp +++ b/src/rl_sar/src/rl_sim.cpp @@ -35,6 +35,7 @@ RL_Sim::RL_Sim() this->InitObservations(); this->InitOutputs(); this->InitControl(); + running_state = STATE_RL_RUNNING; // model std::string model_path = std::string(CMAKE_CURRENT_SOURCE_DIR) + "/models/" + this->robot_name + "/" + this->params.model_name; @@ -138,7 +139,7 @@ void RL_Sim::SetCommand(const RobotCommand *command) this->joint_publishers_commands[i].kd = command->motor_command.kd[i]; this->joint_publishers_commands[i].tau = command->motor_command.tau[i]; } - + for(int i = 0; i < this->params.num_of_dofs; ++i) { this->joint_publishers[this->params.joint_controller_names[i]].publish(this->joint_publishers_commands[i]);