MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit d121b44d authored by ATREVI Dieudonne's avatar ATREVI Dieudonne
Browse files

- Added a menu to allow the modification of scenario's parameters: Press p to access to that menu

- Added the chaos logo as icon when building the project
- Added a button to close the programm
parent d300d977
fileFormatVersion: 2
guid: 906b72cd2e0b5ce5b8bc4f6633eb6064
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -15,7 +15,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
** Authors: Julien Bruneau
** Authors: Julien Bruneau, Fabrice Atrévi
**
** Contact: crowd_group@inria.fr
*/
......@@ -107,7 +107,7 @@ public class LoadEnv : MonoBehaviour
//FB don't know why there this check
//JB to see if it is a relative path or full one
if (ConfigReader.recordingSaveDir[1] != ':')
if (ConfigReader.recordingSaveDir[0] == '.')
cam_Rec.saveDir = Directory.GetCurrentDirectory().Replace("\\", "/") + "/" + ConfigReader.recordingSaveDir;
else
cam_Rec.saveDir = ConfigReader.recordingSaveDir;
......@@ -406,4 +406,46 @@ public class LoadEnv : MonoBehaviour
menuM.configParams();
}
}
public void updateScenario(string trajDir)
{
// ---------------------------------
// update SCENE FROM CONFIG FILE
// -------------
// CAMERA CONFIG
cam_Rec.enabled = true;
cam_Movement.enabled = true;
cam.transform.position = ConfigReader.camPosition;
cam.transform.rotation = Quaternion.Euler(ConfigReader.camRotation);
cam_Movement.lookAt_Id = ConfigReader.camLookAtTarget;
cam_Movement.follow_Id = ConfigReader.camFollowTarget;
cam_Movement.follow_LockX = !ConfigReader.camFollowOnX;
cam_Movement.follow_LockZ = !ConfigReader.camFollowOnY;
// -------------
// RECORD CONFIG
cam_Rec.record = ConfigReader.recording;
cam_Rec.timeToStart = ConfigReader.recordingStart;
cam_Rec.timeToStop = ConfigReader.recordingEnd;
cam_Rec.framerate = ConfigReader.recordingFramerate;
cam_fc.saveImage = ConfigReader.recordOriginalImg;
cam_fc.saveIdSegmentation = ConfigReader.recordSegmentationImg;
cam_fc.saveLayerSegmentation = ConfigReader.recordLayeredSegImg;
cam_fc.saveDepth = ConfigReader.recordDepthImg;
cam_fc.saveNormals = ConfigReader.recordNormalsImg;
cam_fc.saveOpticalFlow = ConfigReader.recordOpticalFlowImg;
if (ConfigReader.recordingSaveDir[0] == '.')
cam_Rec.saveDir = Directory.GetCurrentDirectory().Replace("\\", "/") + "/" + ConfigReader.recordingSaveDir;
else
cam_Rec.saveDir = ConfigReader.recordingSaveDir;
Camera.main.GetComponent<CamRecorder>().Init();
InitDeepRecorders();
cam_Movement.updateTargetedObject();
cam_fc.OnSceneChange();
}
}
\ No newline at end of file
......@@ -46,6 +46,7 @@ public class MenuManager : MonoBehaviour
GameObject panel; // the panel gameObject
GameObject configPanel; // the panel to set the config parameters
LoadEnv env;
/// <summary>
/// initialize the menu
/// </summary>
......@@ -75,7 +76,7 @@ public class MenuManager : MonoBehaviour
/// <returns>selected scenario'S folder path</returns>
public void OpenExplorer()
{
var folderPath = StandaloneFileBrowser.OpenFolderPanel("Choose the scenario's folder", "", true);
var folderPath = StandaloneFileBrowser.OpenFolderPanel("Choose the scenario's folder", "", false);
if (folderPath.Length == 0) {
return;
}
......@@ -139,7 +140,7 @@ public class MenuManager : MonoBehaviour
obstReader.createObstacles(ConfigReader.obstaclesFile, ConfigReader.stageInfos);
LoadEnv env = gameObject.GetComponent<LoadEnv>();
env = gameObject.GetComponent<LoadEnv>();
env.loadScenario(ConfigReader.trajectoriesDir);
panel.SetActive(false);
configPanel.SetActive(false);
......@@ -224,6 +225,7 @@ public class MenuManager : MonoBehaviour
{
//SceneManager.LoadScene("paramConfig");
configPanel.SetActive(!configPanel.activeSelf);
ConfigManager.showConfig();
}
/// <summary>
......@@ -231,7 +233,11 @@ public class MenuManager : MonoBehaviour
/// </summary>
public void saveConfig()
{
ConfigReader.SaveConfig(configPath);
ConfigManager.SaveConfig(configPath);
configPanel.SetActive(!configPanel.activeSelf);
ConfigReader.LoadConfig(configPath);
env.updateScenario(ConfigReader.trajectoriesDir);
}
/// <summary>
......
/* Crowd Simulator Engine
** Copyright (C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
** Authors: Fabrice Atrevi
**
** Contact: crowd_group@inria.fr
*/
using UnityEngine;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Text;
using UnityEngine.UI;
using System.Collections.Generic;
using SFB;
/// <summary>
/// Static class used to set the simulation parameters from the interface.
/// </summary>
public class ConfigManager : MonoBehaviour
{
public static GameObject PanelCamera, PanelRecording, PanelStageEnv;
public static InputField LookAgent, FollowAgent;
public static void showConfig()
{
/// Get Camera Config
// Position
Vector3 camPos = ConfigReader.camPosition;
PanelCamera = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel");
PanelCamera.transform.Find("PosX").GetComponent<InputField>().text = camPos.x.ToString();
PanelCamera.transform.Find("PosY").GetComponent<InputField>().text = camPos.y.ToString();
PanelCamera.transform.Find("PosZ").GetComponent<InputField>().text = camPos.z.ToString();
// Rotation
Vector3 camRot = ConfigReader.camRotation;
PanelCamera.transform.Find("RotX").GetComponent<InputField>().text = camRot.x.ToString();
PanelCamera.transform.Find("RotY").GetComponent<InputField>().text = camRot.y.ToString();
PanelCamera.transform.Find("RotZ").GetComponent<InputField>().text = camRot.z.ToString();
// Look At Agent
PanelCamera.transform.Find("LookAgentID").GetComponent<InputField>().text = ConfigReader.camLookAtTarget.ToString();
// Follow Agent
PanelCamera.transform.Find("FollowAgentID").GetComponent<InputField>().text = ConfigReader.camFollowTarget.ToString();
PanelCamera.transform.Find("FollowX").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnX;
PanelCamera.transform.Find("FollowY").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnY;
/// Get Recording parameters
// Duration
PanelRecording = GameObject.Find("/ConfigMenu/Panel/PanelRecording/Button/Panel");
PanelRecording.transform.Find("startVal").GetComponent<InputField>().text = ConfigReader.recordingStart.ToString();
PanelRecording.transform.Find("endVal").GetComponent<InputField>().text = ConfigReader.recordingEnd.ToString();
// FPS
PanelRecording.transform.Find("fps").GetComponent<InputField>().text = ConfigReader.recordingFramerate.ToString();
// Save Path
PanelRecording.transform.Find("savedirVal").GetComponent<Text>().text = ConfigReader.recordingSaveDir;
// Save Datas
PanelRecording.transform.Find("imgOri").GetComponent<Toggle>().isOn = ConfigReader.recordOriginalImg;
PanelRecording.transform.Find("imgSeg").GetComponent<Toggle>().isOn = ConfigReader.recordSegmentationImg;
PanelRecording.transform.Find("imgCat").GetComponent<Toggle>().isOn = ConfigReader.recordLayeredSegImg;
PanelRecording.transform.Find("imgDepth").GetComponent<Toggle>().isOn = ConfigReader.recordDepthImg;
PanelRecording.transform.Find("imgNor").GetComponent<Toggle>().isOn = ConfigReader.recordNormalsImg;
PanelRecording.transform.Find("imgOF").GetComponent<Toggle>().isOn = ConfigReader.recordOpticalFlowImg;
PanelRecording.transform.Find("imgBBox").GetComponent<Toggle>().isOn = ConfigReader.recordBodyBoudingBoxes;
PanelRecording.transform.Find("imgHBox").GetComponent<Toggle>().isOn = ConfigReader.recordHeadBoundingBoxes;
/// Get Environnement parameters
PanelStageEnv = GameObject.Find("/ConfigMenu/Panel/PanelStageEnv/Button/Panel");
PanelStageEnv.transform.Find("EnvFilePathVal").GetComponent<Text>().text = ConfigReader.trajectoriesDir;
PanelStageEnv.transform.Find("ObstFilePathVal").GetComponent<Text>().text = ConfigReader.obstaclesFile;
}
public static void SaveConfig(string configPath)
{
//// Set Camera Config
// Position
Vector3 camPos;
PanelCamera = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel");
camPos.x = float.Parse(PanelCamera.transform.Find("PosX").GetComponent<InputField>().text);
camPos.y = float.Parse(PanelCamera.transform.Find("PosY").GetComponent<InputField>().text);
camPos.z = float.Parse(PanelCamera.transform.Find("PosZ").GetComponent<InputField>().text);
ConfigReader.camPosition = camPos;
// Rotation
Vector3 camRot;
camRot.x = float.Parse(PanelCamera.transform.Find("RotX").GetComponent<InputField>().text);
camRot.y = float.Parse(PanelCamera.transform.Find("RotY").GetComponent<InputField>().text);
camRot.z = float.Parse(PanelCamera.transform.Find("RotZ").GetComponent<InputField>().text);
ConfigReader.camRotation = camRot;
// Look At Agent
ConfigReader.camLookAtTarget = int.Parse(PanelCamera.transform.Find("LookAgentID").GetComponent<InputField>().text);
// Follow Agent
ConfigReader.camFollowTarget = int.Parse(PanelCamera.transform.Find("FollowAgentID").GetComponent<InputField>().text);
ConfigReader.camFollowOnX = PanelCamera.transform.Find("FollowX").GetComponent<Toggle>().isOn;
ConfigReader.camFollowOnY = PanelCamera.transform.Find("FollowY").GetComponent<Toggle>().isOn;
//// Set Recording parameters
// Duration
PanelRecording = GameObject.Find("/ConfigMenu/Panel/PanelRecording/Button/Panel");
ConfigReader.recordingStart = int.Parse(PanelRecording.transform.Find("startVal").GetComponent<InputField>().text);
ConfigReader.recordingEnd = int.Parse(PanelRecording.transform.Find("endVal").GetComponent<InputField>().text);
// FPS
ConfigReader.recordingFramerate = int.Parse(PanelRecording.transform.Find("fps").GetComponent<InputField>().text);
// Save Datas
ConfigReader.recordOriginalImg = PanelRecording.transform.Find("imgOri").GetComponent<Toggle>().isOn;
ConfigReader.recordSegmentationImg = PanelRecording.transform.Find("imgSeg").GetComponent<Toggle>().isOn;
ConfigReader.recordLayeredSegImg = PanelRecording.transform.Find("imgCat").GetComponent<Toggle>().isOn;
ConfigReader.recordDepthImg = PanelRecording.transform.Find("imgDepth").GetComponent<Toggle>().isOn;
ConfigReader.recordNormalsImg = PanelRecording.transform.Find("imgNor").GetComponent<Toggle>().isOn;
ConfigReader.recordOpticalFlowImg = PanelRecording.transform.Find("imgOF").GetComponent<Toggle>().isOn;
ConfigReader.recordBodyBoudingBoxes = PanelRecording.transform.Find("imgBBox").GetComponent<Toggle>().isOn;
ConfigReader.recordHeadBoundingBoxes = PanelRecording.transform.Find("imgHBox").GetComponent<Toggle>().isOn;
ConfigReader.SaveConfig(configPath);
}
public void saveDirBrowse()
{
// Save Path
string oldPath, newPath;
PanelRecording = GameObject.Find("/ConfigMenu/Panel/PanelRecording/Button/Panel");
oldPath = PanelRecording.transform.Find("savedirVal").GetComponent<Text>().text;
newPath = OpenFolderExplorer();
if(newPath == "")
{
ConfigReader.trajectoriesDir = oldPath;
}
else
{
//string[] splitPath = newPath.Split('/');
//newPath = "./"+splitPath[splitPath.Length-1]+"/";
newPath = newPath+"/";
ConfigReader.recordingSaveDir = newPath;
PanelRecording.transform.Find("savedirVal").GetComponent<Text>().text = newPath;
}
}
public void envDirBrowse()
{
// Save Path
string oldPath, newPath;
PanelStageEnv = GameObject.Find("/ConfigMenu/Panel/PanelStageEnv/Button/Panel");
oldPath = PanelStageEnv.transform.Find("EnvFilePathVal").GetComponent<Text>().text;
newPath = OpenFolderExplorer();
if(newPath == "")
{
ConfigReader.recordingSaveDir = oldPath;
}
else
{
newPath = newPath+"/";
ConfigReader.trajectoriesDir = newPath;
PanelStageEnv.transform.Find("EnvFilePathVal").GetComponent<Text>().text = newPath;
}
}
public void obstacleFileBrowse()
{
// File Path
string oldPath, newPath;
PanelStageEnv = GameObject.Find("/ConfigMenu/Panel/PanelStageEnv/Button/Panel");
oldPath = PanelStageEnv.transform.Find("ObstFilePathVal").GetComponent<Text>().text;
newPath = OpenFileExplorer("xml");
if(newPath == "")
{
ConfigReader.obstaclesFile = oldPath;
}
else
{
ConfigReader.obstaclesFile = newPath;
PanelStageEnv.transform.Find("ObstFilePathVal").GetComponent<Text>().text = newPath;
}
}
public string OpenFolderExplorer()
{
var folderPath = StandaloneFileBrowser.OpenFolderPanel("Choose a folder", "", false);
string path="";
foreach (var p in folderPath) {
path += p;
}
return path;
}
public string OpenFileExplorer(string extension)
{
string[] filePath = StandaloneFileBrowser.OpenFilePanel("Choose a File", "", extension, false);
string path="";
foreach (var p in filePath) {
path += p;
}
return path;
}
}
fileFormatVersion: 2
guid: 45c819b9adfd8a7ebb2fbb22936ddf2f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -15,7 +15,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
** Authors: Julien Bruneau
** Authors: Julien Bruneau, Fabrice Atrevi
**
** Contact: crowd_group@inria.fr
*/
......@@ -96,6 +96,7 @@ public static class ConfigReader
static public string trajectoriesDir
{
get { return data.env_filesPath; }
set { data.env_filesPath = value; }
}
/// <summary>
/// Data about an AssetBundle to load
......@@ -110,6 +111,7 @@ public static class ConfigReader
static public string obstaclesFile
{
get { return data.env_obstFile; }
set { data.env_obstFile = value; }
}
/// <summary>
/// Starting camera position
......@@ -133,6 +135,7 @@ public static class ConfigReader
static public int camLookAtTarget
{
get { return data.cam.lookAtAgent == null ? -1 : data.cam.lookAtAgent.id; }
set { data.cam.lookAtAgent.id = value;}
}
/// <summary>
/// ID of the agent to follow with the camera
......@@ -140,6 +143,7 @@ public static class ConfigReader
static public int camFollowTarget
{
get { return data.cam.followAgent == null ? -1 : data.cam.followAgent.id; }
set { data.cam.followAgent.id = value;}
}
/// <summary>
/// Boolean, true if camera follow an agent's translation of the axe X
......@@ -147,6 +151,7 @@ public static class ConfigReader
static public bool camFollowOnX
{
get { return data.cam.followAgent == null ? false : data.cam.followAgent.followX; }
set { data.cam.followAgent.followX = value;}
}
/// <summary>
/// Boolean, true if camera follow an agent's translation of the axe Y
......@@ -154,6 +159,7 @@ public static class ConfigReader
static public bool camFollowOnY
{
get { return data.cam.followAgent == null ? false : data.cam.followAgent.followY; }
set { data.cam.followAgent.followY = value;}
}
/// <summary>
/// Boolean, true if the animation should be recorded
......@@ -168,6 +174,7 @@ public static class ConfigReader
static public float recordingStart
{
get { return data.recording.start; }
set { data.recording.start = value;}
}
/// <summary>
/// Time to stop the recording of the animation
......@@ -175,6 +182,7 @@ public static class ConfigReader
static public float recordingEnd
{
get { return data.recording.end; }
set { data.recording.end = value;}
}
/// <summary>
/// Framerate used for the recording of the animation
......@@ -182,6 +190,7 @@ public static class ConfigReader
static public int recordingFramerate
{
get { return data.recording.framerate; }
set { data.recording.framerate = value;}
}
/// <summary>
/// Folder where all the images from the animation are recorded
......@@ -189,6 +198,7 @@ public static class ConfigReader
static public string recordingSaveDir
{
get { return data.recording.saveDir; }
set { data.recording.saveDir = value;}
}
/// <summary>
......@@ -197,6 +207,7 @@ public static class ConfigReader
static public bool recordOriginalImg
{
get { return data.recording.savedData.ImgOriginal; }
set { data.recording.savedData.ImgOriginal = value;}
}
/// <summary>
/// Indicate if body bounding boxes should be recorded
......@@ -204,6 +215,7 @@ public static class ConfigReader
static public bool recordSegmentationImg
{
get { return data.recording.savedData.ImgSegmentation; }
set { data.recording.savedData.ImgSegmentation = value;}
}
/// <summary>
/// Indicate if body bounding boxes should be recorded
......@@ -211,6 +223,7 @@ public static class ConfigReader
static public bool recordLayeredSegImg
{
get { return data.recording.savedData.ImgCategories; }
set { data.recording.savedData.ImgCategories = value;}
}
/// <summary>
/// Indicate if body bounding boxes should be recorded
......@@ -218,6 +231,7 @@ public static class ConfigReader
static public bool recordDepthImg
{
get { return data.recording.savedData.ImgDepth; }
set { data.recording.savedData.ImgDepth = value;}
}
/// <summary>
/// Indicate if body bounding boxes should be recorded
......@@ -225,6 +239,7 @@ public static class ConfigReader
static public bool recordNormalsImg
{
get { return data.recording.savedData.ImgNormals; }
set { data.recording.savedData.ImgNormals = value;}
}
/// <summary>
/// Indicate if body bounding boxes should be recorded
......@@ -232,6 +247,7 @@ public static class ConfigReader
static public bool recordOpticalFlowImg
{
get { return data.recording.savedData.ImgOpticalFlow; }
set { data.recording.savedData.ImgOpticalFlow = value;}
}
/// <summary>
......@@ -240,6 +256,7 @@ public static class ConfigReader
static public bool recordBodyBoudingBoxes
{
get { return data.recording.savedData.BodyBoundingBoxes; }
set { data.recording.savedData.BodyBoundingBoxes = value;}
}
/// <summary>
......@@ -248,6 +265,7 @@ public static class ConfigReader
static public bool recordHeadBoundingBoxes