Allow mocap bodies to be loaded by the Unity plugin.

PiperOrigin-RevId: 558735711
Change-Id: Ibc9a81cbf8ec4b979d5b325c822c1bffc1408509
This commit is contained in:
Joss Moore
2023-08-21 03:27:56 -07:00
committed by Copybara-Service
parent ed4bb2aab5
commit ef699d4b6d
4 changed files with 22 additions and 7 deletions
@@ -20,7 +20,7 @@ using UnityEngine;
namespace Mujoco {
public class MjBodyQuaternionSensor : MjBaseSensor {
public MjBody Body;
public MjBaseBody Body;
[Tooltip("Should the Frame sensors use the inertial or the regular frame of reference.")]
public bool UseInertialFrame;
@@ -39,7 +39,7 @@ public class MjBodyQuaternionSensor : MjBaseSensor {
protected override void FromMjcf(XmlElement mjcf) {
UseInertialFrame = mjcf.HasAttribute("body");
Body = mjcf.GetObjectReferenceAttribute<MjBody>("objname");
Body = mjcf.GetObjectReferenceAttribute<MjBaseBody>("objname");
if (Body == null) {
throw new NullReferenceException("Missing a reference to a MjBody.");
}