浏览代码

Remove RB sensor and add X Z velocity obs

/develop/grid-rootref-debug
Ervin Teng 4 年前
当前提交
7b78da61
共有 2 个文件被更改,包括 13 次插入27 次删除
  1. 30
      Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockAgentGridCollab.prefab
  2. 10
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentCollab.cs

30
Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockAgentGridCollab.prefab


m_CellScale: {x: 1, y: 0.5, z: 1}
m_GridSize: {x: 20, y: 1, z: 20}
m_RotateWithAgent: 1
m_RootReference: {fileID: 0}
m_DetectableTags:
- wall
- agent

- component: {fileID: 2698669610236060893}
- component: {fileID: 6481017652691923713}
- component: {fileID: 2106090979146236401}
- component: {fileID: 294674626881224982}
m_Layer: 0
m_Name: PushBlockAgentGridCollab
m_TagString: agent

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 0
NumStackedVectorObservations: 2
VectorObservationSize: 2
NumStackedVectorObservations: 1
m_ActionSpec:
m_NumContinuousActions: 0
BranchSizes: 07000000

m_Name:
m_EditorClassIdentifier:
debugCommandLineOverride:
--- !u!114 &294674626881224982
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2710286047221272849}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: df0f8be9a37d6486498061e2cbc4cd94, type: 3}
m_Name:
m_EditorClassIdentifier:
RootBody: {fileID: 2691837803371243691}
VirtualRoot: {fileID: 2710286047221272849}
Settings:
UseModelSpaceTranslations: 0
UseModelSpaceRotations: 0
UseLocalSpaceTranslations: 1
UseLocalSpaceRotations: 1
UseModelSpaceLinearVelocity: 1
UseLocalSpaceLinearVelocity: 0
UseJointPositionsAndAngles: 0
UseJointForces: 0
sensorName: RBSensor
--- !u!1 &2710572731397926669
GameObject:
m_ObjectHideFlags: 0

10
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentCollab.cs


using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Sensors;
public class PushAgentCollab : Agent
{

{
// Move the agent using the action.
MoveAgent(actionBuffers.DiscreteActions);
}
/// <summary>
/// Called every time a decision is requested.
/// </summary>
public override void CollectObservations(VectorSensor sensor)
{
sensor.AddObservation(Vector3.Dot(m_AgentRb.velocity, m_AgentRb.transform.forward));
sensor.AddObservation(Vector3.Dot(m_AgentRb.velocity, m_AgentRb.transform.right));
}
public override void Heuristic(in ActionBuffers actionsOut)

正在加载...
取消
保存