Skip to content

RobotAgent

abstract class · namespace Hazel

public abstract class RobotAgent

Constructors

RobotAgent(float, string, string)

public RobotAgent(float dt, string motionDataset = "", string policyPath = "")

Fields

Field Description
protected float[] m_ActionBuffer
protected int m_ActionOffset
protected int[] m_ActuatorIds
protected AnimationComponent? m_AnimationComponent
protected RefPoseCalibrator? m_Calibrator
protected float[] m_CtrlBuffer
protected int m_CtrlOffset
public uint m_DatasetAnchorId
protected uint m_FreeJointId
public bool m_IsCalibrating
protected uint[] m_JointQposAdrs
protected uint[] m_JointQvelAdrs
public MujocoSceneComponent m_MujocoScene
public uint m_PelvisBodyId
public uint m_PelvisDatasetId
public RefPoseExtractor? m_RefPoseExtractor
protected uint m_RobotAnchorId
protected RobotManager m_RobotManager
protected float[] m_StateBuffer
protected int m_StateOffset

Properties

ActionSize

public int ActionSize { get; protected set; }

CalibrationTargets

protected virtual List<CalibrationMapping> CalibrationTargets { get; }

CommandManager

public CommandManager CommandManager { get; }

JointSpec

protected abstract List<JointConfig> JointSpec { get; }

m_dt

public float m_dt { get; }

m_ID

public int m_ID { get; protected set; }

m_MotionDataset

public string m_MotionDataset { get; }

m_NeedsCalibration

protected abstract bool m_NeedsCalibration { get; }

m_NumJoints

protected int m_NumJoints { get; }

m_PolicyPath

public string m_PolicyPath { get; }

StateSize

public int StateSize { get; protected set; }

StateSpec

protected abstract List<StateConfig> StateSpec { get; }

Methods

Action()

public void Action()

ApplyAdditionalJointOffsets(float[])

public void ApplyAdditionalJointOffsets(float[] extraOffsets)

BindBatchBuffers(float[], int, float[], int, float[], int)

public void BindBatchBuffers(float[] stateBuffer, int stateOffset, float[] actionBuffer, int actionOffset, float[] ctrlBuffer, int ctrlOffset)

CacheJointHandles(List)

protected void CacheJointHandles(List<JointConfig> specs)

CaptureInitialPose()

public void CaptureInitialPose()

ClearBuffers()

public void ClearBuffers()

GetActuatorIndices()

public int[] GetActuatorIndices()

GetAxisMapping()

public virtual Dictionary<string, (string axis, bool invert)>? GetAxisMapping()

GetDefaultJointPos()

public List<float> GetDefaultJointPos()

GetJointNames()

public List<string> GetJointNames()

GetJointQposAdrs()

public uint[] GetJointQposAdrs()

GetJointQvelAdrs()

public uint[] GetJointQvelAdrs()

GetMotionAnchorPoseMj(Vector3, Quaternion)

public void GetMotionAnchorPoseMj(out Vector3 posMj, out Quaternion quatMj)

Get motion anchor pose in MuJoCo space (for observation). When RefPoseExtractor is null, returns Zero/Identity.

GetMotionJointPos()

public float[] GetMotionJointPos()

GetStateSpec()

public List<StateConfig> GetStateSpec()

OnAction()

public abstract void OnAction()

OnReset()

public abstract void OnReset()

OnSetup()

public abstract void OnSetup()

OnState()

public abstract void OnState()

SetCalibrationOffsets(float[])

public void SetCalibrationOffsets(float[] offsets)

SetMujocoScene(MujocoSceneComponent)

public void SetMujocoScene(MujocoSceneComponent mujocoScene)

SetRobotManager(RobotManager)

public void SetRobotManager(RobotManager robotManager)

Setup(RobotManager, MujocoSceneComponent, int, bool)

public void Setup(RobotManager robotManager, MujocoSceneComponent mujocoScene, int ID, bool isExternalBatch = false)

UpdateCalibration()

public void UpdateCalibration()

Source: Hazel/Learn/RobotAgent.cs