diff --git a/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/ETHCrowdSubscriber.cs b/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/ETHCrowdSubscriber.cs index a22230ee79c7b4264cb89e0200ddf151cf78d8f8..386553565e6ec33852faf3f4c07bd0070dcd5627 100644 --- a/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/ETHCrowdSubscriber.cs +++ b/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/ETHCrowdSubscriber.cs @@ -39,8 +39,8 @@ namespace RosSharp.RosBridgeClient { Vector3 new_pos = new Vector3(); new_pos.x = agent.linear.x; - new_pos.y = agent.linear.z; - new_pos.z = agent.linear.y; + new_pos.y = agent.linear.y; + new_pos.z = agent.linear.z; return new_pos; } diff --git a/Assets/MainAssets/Scripts/Managers/Viz_ExternalTrialManager.cs b/Assets/MainAssets/Scripts/Managers/Viz_ExternalTrialManager.cs index 7de1f8a73d849ddd723480da0167e61800a95a45..85ddce576dba5e930aa003e384479351754d331d 100644 --- a/Assets/MainAssets/Scripts/Managers/Viz_ExternalTrialManager.cs +++ b/Assets/MainAssets/Scripts/Managers/Viz_ExternalTrialManager.cs @@ -1,4 +1,5 @@ +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -104,17 +105,32 @@ public class Viz_ExternalTrialManager : MonoBehaviour, TrialManager { int i = 0; foreach (GameObject a in my_robots) { - Vector3 temp = new Vector3(a.transform.position.x+(float)0.01, 0, 0); - a.transform.position = temp; if (i < all_agents_pos.Count ){ + Vector3 old = a.transform.position; + Vector3 next = all_agents_pos[i]; + float new_heading = all_agents_pos[i].z; a.transform.position = all_agents_pos[i]; + a.transform.rotation = Quaternion.Euler(0, 0, new_heading); } i++; } foreach (GameObject a in humans) { if (i < all_agents_pos.Count ){ - a.transform.position = all_agents_pos[i]; + float new_heading = all_agents_pos[i].z; + a.transform.position = new Vector3( + all_agents_pos[i].x, + a.transform.position.y, + all_agents_pos[i].y + ); + if (all_agents_pos[i].z != 1000.0f) + { + a.transform.eulerAngles = new Vector3( + a.transform.eulerAngles.x, + all_agents_pos[i].z, + a.transform.eulerAngles.z); + } + } i++; } diff --git a/Assets/Scenes/Tests/ETH MBN/Scene 1.unity b/Assets/Scenes/Tests/ETH MBN/Scene 1.unity index 1542d3aee99d3127601651c7319d9d8ce7c10f5c..a68730e55df0cae655d8e71c6b0c54da82416afd 100644 --- a/Assets/Scenes/Tests/ETH MBN/Scene 1.unity +++ b/Assets/Scenes/Tests/ETH MBN/Scene 1.unity @@ -173292,7 +173292,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6649885822423033263} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 1.5, z: 6} + m_LocalPosition: {x: 0, y: 1.5, z: 13.41} m_LocalScale: {x: 30, y: 0.1, z: 3} m_Children: [] m_Father: {fileID: 6070563076589101033} @@ -173579,7 +173579,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6706874437410045391} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 1.5, z: -6} + m_LocalPosition: {x: 0, y: 1.5, z: -16.6} m_LocalScale: {x: 30, y: 0.1, z: 3} m_Children: [] m_Father: {fileID: 6070563076589101033}