Repository navigation
How does deploy work? #89
Replies: 1 comment
|
Isaac Lab itself has no C++ runtime. How it works:
The Unitree SDK is used through the
// isaaclab/assets/articulation/articulation.h, in the data struct
Eigen::Vector3f root_lin_vel_b = Eigen::Vector3f::Zero();
// robots/go2/src/State_RLBase.cpp
class Go2Articulation : public unitree::BaseArticulation<LowState_t::SharedPtr> {
public:
using Base = unitree::BaseArticulation<LowState_t::SharedPtr>;
Go2Articulation(LowState_t::SharedPtr ls)
: Base(ls), sport(std::make_shared<unitree::robot::go2::subscription::SportModeState>()) {}
void update() override {
Base::update();
std::lock_guard<std::mutex> lock(sport->mutex_);
data.root_lin_vel_b = data.root_quat_w.conjugate() * sport->velocity(); // drop the rotation if already body frame
}
std::shared_ptr<unitree::robot::go2::subscription::SportModeState> sport;
};
// use std::make_shared<Go2Articulation>(FSMState::lowstate) in the ManagerBasedRLEnv constructor
// isaaclab/envs/mdp/observations/observations.h
REGISTER_OBSERVATION(base_lin_vel)
{
auto & d = env->robot->data.root_lin_vel_b;
return std::vector<float>(d.data(), d.data() + d.size());
}The deploy program needs |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm looking at the deploy directory and I'm trying to understand how it works so I can build upon it. If I'm understanding this code correctly, is it true that isaac lab has cpp support for manager based rl environments and that we're using that system to run inference on the policy? Also, how is rl lab interfacing with the unitree sdk? I see it linked in the cmakelist but not included in any code. I would appreciate any answer to those questions. Also, if there's a general guide that could answer those questions, please refer them to me.
I would also be grateful for any advice about reading from rt/sportmodestate to provide a base_lin_vel observation to the policy.
Thank you
All reactions