浏览代码

Modify crawler to make variable speed use goals

/goal-conditioning/new
Arthur Juliani 4 年前
当前提交
9d172102
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2
      Project/Assets/ML-Agents/Examples/Crawler/Prefabs/CrawlerBase.prefab
  2. 4
      Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs

2
Project/Assets/ML-Agents/Examples/Crawler/Prefabs/CrawlerBase.prefab


m_Script: {fileID: 11500000, guid: fd48a95d788a348b0b7a8cefd39e7c27, type: 3}
m_Name:
m_EditorClassIdentifier:
observationSize: 3
observationSize: 6
--- !u!1 &4845971001730692034
GameObject:
m_ObjectHideFlags: 0

4
Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs


/// </summary>
public override void CollectObservations(VectorSensor sensor)
{
goalSensor = this.GetComponent<GoalSensorComponent>();
var cubeForward = m_OrientationCube.transform.forward;
//velocity we want to match

//avg body vel relative to cube
sensor.AddObservation(m_OrientationCube.transform.InverseTransformDirection(avgVel));
//vel goal relative to cube
sensor.AddObservation(m_OrientationCube.transform.InverseTransformDirection(velGoal));
goalSensor.AddGoal(m_OrientationCube.transform.InverseTransformDirection(velGoal));
goalSensor = this.GetComponent<GoalSensorComponent>();
goalSensor.AddGoal(m_OrientationCube.transform.InverseTransformPoint(m_Target.transform.position));
RaycastHit hit;

正在加载...
取消
保存