Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c332fc42 authored by Fabien Grzeskowiak's avatar Fabien Grzeskowiak
Browse files

tcp network wip

parent d705c55e
Branches
No related tags found
No related merge requests found
Showing
with 654 additions and 222 deletions
File added
fileFormatVersion: 2
guid: 670c1e35731857015bc3a5395c04c05c
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 1
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:
......@@ -67,7 +67,7 @@ namespace CrowdMP.Core
if (ObstWall.isClockwise(center, wall.A, wall.B) > 0)
{
Debug.Log("Clockwise");
// Debug.Log("Clockwise");
poly.Add(-wall.A.x);
poly.Add(wall.A.z);
......
fileFormatVersion: 2
guid: 38943476182f86240ab892af3d6a939c
ModelImporter:
serializedVersion: 23
fileIDToRecycleName:
100000: Chest
100002: //RootNode
100004: Head
100006: Hips
100008: Jaw
100010: JawEND
100012: LeftArm
100014: LeftCheek
100016: LeftEye
100018: LeftEyelidLower
100020: LeftEyelidUpper
100022: LeftFoot
100024: LeftForeArm
100026: LeftHand
100028: LeftHandIndex1
100030: LeftHandIndex2
100032: LeftHandIndex3
100034: LeftHandMiddle1
100036: LeftHandMiddle2
100038: LeftHandMiddle3
100040: LeftHandPinky1
100042: LeftHandPinky2
100044: LeftHandPinky3
100046: LeftHandRing1
100048: LeftHandRing2
100050: LeftHandRing3
100052: LeftHandThumb1
100054: LeftHandThumb2
100056: LeftHandThumb3
100058: LeftInnerBrow
100060: LeftIOuterBrow
100062: LeftLeg
100064: LeftLipCorner
100066: LeftLipLower
100068: LeftLipUpper
100070: LeftNostril
100072: LeftShoulder
100074: LeftToes
100076: LeftUpLeg
100078: Neck
100080: Reference
100082: RightArm
100084: RightCheek
100086: RightEye
100088: RightEyelidLower
100090: RightEyelidUpper
100092: RightFoot
100094: RightForeArm
100096: RightHand
100098: RightHandIndex1
100100: RightHandIndex2
100102: RightHandIndex3
100104: RightHandMiddle1
100106: RightHandMiddle2
100108: RightHandMiddle3
100110: RightHandPinky1
100112: RightHandPinky2
100114: RightHandPinky3
100116: RightHandRing1
100118: RightHandRing2
100120: RightHandRing3
100122: RightHandThumb1
100124: RightHandThumb2
100126: RightHandThumb3
100128: RightInnerBrow
100130: RightIOuterBrow
100132: RightLeg
100134: RightLipCorner
100136: RightLipLower
100138: RightLipUpper
100140: RightNostril
100142: RightShoulder
100144: RightToes
100146: RightUpLeg
100148: Spine
100150: TongueBack
100152: TongueTip
400000: Chest
400002: //RootNode
400004: Head
400006: Hips
400008: Jaw
400010: JawEND
400012: LeftArm
400014: LeftCheek
400016: LeftEye
400018: LeftEyelidLower
400020: LeftEyelidUpper
400022: LeftFoot
400024: LeftForeArm
400026: LeftHand
400028: LeftHandIndex1
400030: LeftHandIndex2
400032: LeftHandIndex3
400034: LeftHandMiddle1
400036: LeftHandMiddle2
400038: LeftHandMiddle3
400040: LeftHandPinky1
400042: LeftHandPinky2
400044: LeftHandPinky3
400046: LeftHandRing1
400048: LeftHandRing2
400050: LeftHandRing3
400052: LeftHandThumb1
400054: LeftHandThumb2
400056: LeftHandThumb3
400058: LeftInnerBrow
400060: LeftIOuterBrow
400062: LeftLeg
400064: LeftLipCorner
400066: LeftLipLower
400068: LeftLipUpper
400070: LeftNostril
400072: LeftShoulder
400074: LeftToes
400076: LeftUpLeg
400078: Neck
400080: Reference
400082: RightArm
400084: RightCheek
400086: RightEye
400088: RightEyelidLower
400090: RightEyelidUpper
400092: RightFoot
400094: RightForeArm
400096: RightHand
400098: RightHandIndex1
400100: RightHandIndex2
400102: RightHandIndex3
400104: RightHandMiddle1
400106: RightHandMiddle2
400108: RightHandMiddle3
400110: RightHandPinky1
400112: RightHandPinky2
400114: RightHandPinky3
400116: RightHandRing1
400118: RightHandRing2
400120: RightHandRing3
400122: RightHandThumb1
400124: RightHandThumb2
400126: RightHandThumb3
400128: RightInnerBrow
400130: RightIOuterBrow
400132: RightLeg
400134: RightLipCorner
400136: RightLipLower
400138: RightLipUpper
400140: RightNostril
400142: RightShoulder
400144: RightToes
400146: RightUpLeg
400148: Spine
400150: TongueBack
400152: TongueTip
7400000: Walk
9500000: //RootNode
2186277476908879412: ImportLogs
serializedVersion: 19300
internalIDToNameTable:
- first:
1: 100000
second: Chest
- first:
1: 100002
second: //RootNode
- first:
1: 100004
second: Head
- first:
1: 100006
second: Hips
- first:
1: 100008
second: Jaw
- first:
1: 100010
second: JawEND
- first:
1: 100012
second: LeftArm
- first:
1: 100014
second: LeftCheek
- first:
1: 100016
second: LeftEye
- first:
1: 100018
second: LeftEyelidLower
- first:
1: 100020
second: LeftEyelidUpper
- first:
1: 100022
second: LeftFoot
- first:
1: 100024
second: LeftForeArm
- first:
1: 100026
second: LeftHand
- first:
1: 100028
second: LeftHandIndex1
- first:
1: 100030
second: LeftHandIndex2
- first:
1: 100032
second: LeftHandIndex3
- first:
1: 100034
second: LeftHandMiddle1
- first:
1: 100036
second: LeftHandMiddle2
- first:
1: 100038
second: LeftHandMiddle3
- first:
1: 100040
second: LeftHandPinky1
- first:
1: 100042
second: LeftHandPinky2
- first:
1: 100044
second: LeftHandPinky3
- first:
1: 100046
second: LeftHandRing1
- first:
1: 100048
second: LeftHandRing2
- first:
1: 100050
second: LeftHandRing3
- first:
1: 100052
second: LeftHandThumb1
- first:
1: 100054
second: LeftHandThumb2
- first:
1: 100056
second: LeftHandThumb3
- first:
1: 100058
second: LeftInnerBrow
- first:
1: 100060
second: LeftIOuterBrow
- first:
1: 100062
second: LeftLeg
- first:
1: 100064
second: LeftLipCorner
- first:
1: 100066
second: LeftLipLower
- first:
1: 100068
second: LeftLipUpper
- first:
1: 100070
second: LeftNostril
- first:
1: 100072
second: LeftShoulder
- first:
1: 100074
second: LeftToes
- first:
1: 100076
second: LeftUpLeg
- first:
1: 100078
second: Neck
- first:
1: 100080
second: Reference
- first:
1: 100082
second: RightArm
- first:
1: 100084
second: RightCheek
- first:
1: 100086
second: RightEye
- first:
1: 100088
second: RightEyelidLower
- first:
1: 100090
second: RightEyelidUpper
- first:
1: 100092
second: RightFoot
- first:
1: 100094
second: RightForeArm
- first:
1: 100096
second: RightHand
- first:
1: 100098
second: RightHandIndex1
- first:
1: 100100
second: RightHandIndex2
- first:
1: 100102
second: RightHandIndex3
- first:
1: 100104
second: RightHandMiddle1
- first:
1: 100106
second: RightHandMiddle2
- first:
1: 100108
second: RightHandMiddle3
- first:
1: 100110
second: RightHandPinky1
- first:
1: 100112
second: RightHandPinky2
- first:
1: 100114
second: RightHandPinky3
- first:
1: 100116
second: RightHandRing1
- first:
1: 100118
second: RightHandRing2
- first:
1: 100120
second: RightHandRing3
- first:
1: 100122
second: RightHandThumb1
- first:
1: 100124
second: RightHandThumb2
- first:
1: 100126
second: RightHandThumb3
- first:
1: 100128
second: RightInnerBrow
- first:
1: 100130
second: RightIOuterBrow
- first:
1: 100132
second: RightLeg
- first:
1: 100134
second: RightLipCorner
- first:
1: 100136
second: RightLipLower
- first:
1: 100138
second: RightLipUpper
- first:
1: 100140
second: RightNostril
- first:
1: 100142
second: RightShoulder
- first:
1: 100144
second: RightToes
- first:
1: 100146
second: RightUpLeg
- first:
1: 100148
second: Spine
- first:
1: 100150
second: TongueBack
- first:
1: 100152
second: TongueTip
- first:
4: 400000
second: Chest
- first:
4: 400002
second: //RootNode
- first:
4: 400004
second: Head
- first:
4: 400006
second: Hips
- first:
4: 400008
second: Jaw
- first:
4: 400010
second: JawEND
- first:
4: 400012
second: LeftArm
- first:
4: 400014
second: LeftCheek
- first:
4: 400016
second: LeftEye
- first:
4: 400018
second: LeftEyelidLower
- first:
4: 400020
second: LeftEyelidUpper
- first:
4: 400022
second: LeftFoot
- first:
4: 400024
second: LeftForeArm
- first:
4: 400026
second: LeftHand
- first:
4: 400028
second: LeftHandIndex1
- first:
4: 400030
second: LeftHandIndex2
- first:
4: 400032
second: LeftHandIndex3
- first:
4: 400034
second: LeftHandMiddle1
- first:
4: 400036
second: LeftHandMiddle2
- first:
4: 400038
second: LeftHandMiddle3
- first:
4: 400040
second: LeftHandPinky1
- first:
4: 400042
second: LeftHandPinky2
- first:
4: 400044
second: LeftHandPinky3
- first:
4: 400046
second: LeftHandRing1
- first:
4: 400048
second: LeftHandRing2
- first:
4: 400050
second: LeftHandRing3
- first:
4: 400052
second: LeftHandThumb1
- first:
4: 400054
second: LeftHandThumb2
- first:
4: 400056
second: LeftHandThumb3
- first:
4: 400058
second: LeftInnerBrow
- first:
4: 400060
second: LeftIOuterBrow
- first:
4: 400062
second: LeftLeg
- first:
4: 400064
second: LeftLipCorner
- first:
4: 400066
second: LeftLipLower
- first:
4: 400068
second: LeftLipUpper
- first:
4: 400070
second: LeftNostril
- first:
4: 400072
second: LeftShoulder
- first:
4: 400074
second: LeftToes
- first:
4: 400076
second: LeftUpLeg
- first:
4: 400078
second: Neck
- first:
4: 400080
second: Reference
- first:
4: 400082
second: RightArm
- first:
4: 400084
second: RightCheek
- first:
4: 400086
second: RightEye
- first:
4: 400088
second: RightEyelidLower
- first:
4: 400090
second: RightEyelidUpper
- first:
4: 400092
second: RightFoot
- first:
4: 400094
second: RightForeArm
- first:
4: 400096
second: RightHand
- first:
4: 400098
second: RightHandIndex1
- first:
4: 400100
second: RightHandIndex2
- first:
4: 400102
second: RightHandIndex3
- first:
4: 400104
second: RightHandMiddle1
- first:
4: 400106
second: RightHandMiddle2
- first:
4: 400108
second: RightHandMiddle3
- first:
4: 400110
second: RightHandPinky1
- first:
4: 400112
second: RightHandPinky2
- first:
4: 400114
second: RightHandPinky3
- first:
4: 400116
second: RightHandRing1
- first:
4: 400118
second: RightHandRing2
- first:
4: 400120
second: RightHandRing3
- first:
4: 400122
second: RightHandThumb1
- first:
4: 400124
second: RightHandThumb2
- first:
4: 400126
second: RightHandThumb3
- first:
4: 400128
second: RightInnerBrow
- first:
4: 400130
second: RightIOuterBrow
- first:
4: 400132
second: RightLeg
- first:
4: 400134
second: RightLipCorner
- first:
4: 400136
second: RightLipLower
- first:
4: 400138
second: RightLipUpper
- first:
4: 400140
second: RightNostril
- first:
4: 400142
second: RightShoulder
- first:
4: 400144
second: RightToes
- first:
4: 400146
second: RightUpLeg
- first:
4: 400148
second: Spine
- first:
4: 400150
second: TongueBack
- first:
4: 400152
second: TongueTip
- first:
74: 7400000
second: Walk
- first:
95: 9500000
second: //RootNode
- first:
41386430: 2186277476908879412
second: ImportLogs
externalObjects: {}
materials:
importMaterials: 1
materialImportMode: 1
materialName: 0
materialSearch: 1
materialLocation: 0
......@@ -193,6 +507,7 @@ ModelImporter:
- serializedVersion: 16
name: Walk
takeName: _1_a_U1_M_P_WalkForward_NtrlFaceFwd__Fb_p0_No_0_PJ_3
internalID: 0
firstFrame: 215.2
lastFrame: 244.9
wrapMode: 0
......@@ -203,9 +518,9 @@ ModelImporter:
hasAdditiveReferencePose: 0
loopTime: 1
loopBlend: 1
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
loopBlendOrientation: 1
loopBlendPositionY: 1
loopBlendPositionXZ: 1
keepOriginalOrientation: 0
keepOriginalPositionY: 0
keepOriginalPositionXZ: 0
......@@ -225,6 +540,7 @@ ModelImporter:
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 0
importBlendShapes: 1
importCameras: 0
......@@ -232,18 +548,19 @@ ModelImporter:
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
indexFormat: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 0
previousCalculatedGlobalScale: 0.01
hasPreviousCalculatedGlobalScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
......@@ -252,10 +569,10 @@ ModelImporter:
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
copyAvatar: 1
humanDescription:
serializedVersion: 2
serializedVersion: 3
human:
- boneName: Hips
humanName: Hips
......@@ -983,14 +1300,17 @@ ModelImporter:
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 0.01
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 0
lastHumanDescriptionAvatarSource: {fileID: 9000000, guid: 2a03116b561b956418f1fc84100e6072,
type: 3}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 3
humanoidOversampling: 1
avatarSetup: 2
additionalBone: 0
userData:
assetBundleName:
......
......@@ -38,11 +38,7 @@ public class AnimationController : MonoBehaviour
_objectAnimator.SetFloat("AngularSpeed", 0);
_objectAnimator.SetInteger("AnimationType", UnityEngine.Random.Range(1,4)); // 1, 2 or 3
#if MIDDLEVR
_objectAnimator.cullingMode = AnimatorCullingMode.CullUpdateTransforms;
_objectAnimator.enabled = false;
#endif
if(ToolsTime.useRos()){
if(ToolsTime.useExternal()){
_objectAnimator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
_objectAnimator.enabled = false;
}
......@@ -73,7 +69,7 @@ public class AnimationController : MonoBehaviour
}
// Update is called once per frame
void Update()
void LateUpdate()
{
if (ToolsTime.DeltaTime != 0)
......@@ -139,33 +135,10 @@ public class AnimationController : MonoBehaviour
_oldRotation = this.transform.rotation;
_oldVelocity = this.transform.forward;
#if MIDDLEVR
_objectAnimator.Update(ToolsTime.DeltaTime);
#endif
if(ToolsTime.useRos()){
if(ToolsTime.useExternal()){
_objectAnimator.Update(ToolsTime.DeltaTime);
}
}
private void LateUpdate()
{
//if (ToolsInput.GetKeyDown(KeyCode.Z))
//{
// idleAnimationID--;
// if (idleAnimationID < -35)
// idleAnimationID = 12;
// ToolsDebug.log("idleAnimationID="+idleAnimationID);
// _objectAnimator.SetFloat("IdleAnimationID", idleAnimationID);
//}
//if (ToolsInput.GetKeyDown(KeyCode.X))
//{
// idleAnimationID++;
// if (idleAnimationID > 12)
// idleAnimationID = -35;
// ToolsDebug.log("idleAnimationID=" + idleAnimationID);
// _objectAnimator.SetFloat("IdleAnimationID", idleAnimationID);
//}
}
}
......@@ -2,6 +2,8 @@
using System.Collections.Generic;
using UnityEngine;
namespace crowdbotsim
{
/// <summary>
/// The main manager controlling the Experiment flow
/// </summary>
......@@ -204,3 +206,5 @@ public class CrowdBotSim_MainManager : MonoBehaviour, MainManager {
}
}
}
}
\ No newline at end of file
......@@ -5,6 +5,9 @@ using UnityEngine;
using CrowdMP.Core;
using RosSharp.RosBridgeClient;
namespace crowdbotsim
{
/// <summary>
/// Regular trial manager with moving agents/player
/// </summary>
......@@ -17,9 +20,13 @@ public class CrowdBotSim_TrialManager : MonoBehaviour, TrialManager {
protected SimManager sims;
List<RosConnector> ROS;
List<Publisher> Ros_Publishers;
List<TcpConnector> Tcp;
List<TcpPublisher> TcpPublishers;
private CrowdStampedPublisher crowdpub;
private bool player_in_sim;
......@@ -46,6 +53,8 @@ public class CrowdBotSim_TrialManager : MonoBehaviour, TrialManager {
foreach(MonoBehaviour p in Ros_Publishers) p.enabled = false;
foreach(MonoBehaviour p in TcpPublishers) p.enabled = false;
foreach(RosConnector r in ROS)
{
......@@ -53,6 +62,11 @@ public class CrowdBotSim_TrialManager : MonoBehaviour, TrialManager {
r.start_scripts = true;
}
foreach(TcpConnector t in Tcp)
{
t.enabled = false;
t.start_scripts = true;
}
GameObject[] my_robots = GameObject.FindGameObjectsWithTag("Robot");
foreach(GameObject r in my_robots)
......@@ -106,11 +120,17 @@ public class CrowdBotSim_TrialManager : MonoBehaviour, TrialManager {
agentsList = new List<Agent>();
if (sims==null)
sims = new SimManager();
if(Ros_Publishers == null)
Ros_Publishers = new List<Publisher>();
if(ROS == null)
ROS = new List<RosConnector>();
if(Tcp == null)
Tcp = new List<TcpConnector>();
if(TcpPublishers == null)
TcpPublishers = new List<TcpPublisher>();
sims.initSimulations(obst);
// Setup the player
......@@ -192,6 +212,7 @@ public class CrowdBotSim_TrialManager : MonoBehaviour, TrialManager {
if(r.activeSelf)
{
ROS.Add(r.transform.Find("RosConnector").gameObject.GetComponent<RosConnector>());
Tcp.Add(r.transform.Find("TcpConnector").gameObject.GetComponent<TcpConnector>());
}
}
......@@ -222,6 +243,34 @@ public class CrowdBotSim_TrialManager : MonoBehaviour, TrialManager {
RosCon.start_scripts = true;
}
foreach(TcpConnector TcpCon in Tcp)
{
TcpPublishers.AddRange(new List<TcpPublisher>(TcpCon.GetComponents<TcpPublisher>()));
foreach(TcpPublisher script in TcpPublishers)
{
// TODO
// if(script.GetType() == typeof(TwistArrayStampedPublisher) )
// {
// ((TwistArrayStampedPublisher)script).agents = new List<Agent>(agentsList);
// }
// if(script.GetType() == typeof(CrowdStampedPublisher) )
// {
// crowdpub = (CrowdStampedPublisher)script;
// crowdpub.agents = new RosSharp.RosBridgeClient.CrowdStampedPublisher.CrowdBotAgent[agentsList.Count];
// for(int j = 0; j < agentsList.Count; j++)
// {
// crowdpub.agents[j] =
// new RosSharp.RosBridgeClient.CrowdStampedPublisher.CrowdBotAgent(
// (int)(agentsList[j].id), agentsList[j].Position,
// Vector3.zero, Vector3.zero, agentsList[j].Position);
// }
// }
}
TcpCon.enabled = true;
TcpCon.start_scripts = true;
}
......@@ -363,3 +412,4 @@ public class CrowdBotSim_TrialManager : MonoBehaviour, TrialManager {
}
}
\ No newline at end of file
......@@ -14,11 +14,12 @@ public static class ToolsTime {
private static float trialTime;
private static float timeSinceTrialStarted;
private static bool bPause;
private static bool use_ros;
private static bool use_external;
private static RosSharp.RosBridgeClient.ClockSubscriber ros_clock;
private static crowdbotsim.TcpClockSubscriber tcp_clock;
public static bool useRos() {return use_ros; }
public static bool useExternal() {return use_external; }
static ToolsTime() {
realDeltaTime = 0;
deltaTime = 0;
......@@ -26,16 +27,20 @@ public static class ToolsTime {
trialTime = 0;
timeSinceTrialStarted = 0;
bPause = false;
GameObject clock = GameObject.FindGameObjectWithTag("Clock");
if(clock != null){
tcp_clock = clock.GetComponent<crowdbotsim.TcpClockSubscriber>();
ros_clock = clock.GetComponent<RosSharp.RosBridgeClient.ClockSubscriber>();
}
use_ros = (ros_clock != null);
if(use_ros)
use_external = (ros_clock != null) || (tcp_clock != null);
if(use_external)
{
Physics.autoSimulation = false;
}
Debug.Log("Use ROS Clock : " + use_ros);
Debug.Log("Use external Clock : " + use_external);
}
public static bool isInPause { get { return bPause; } }
......@@ -43,32 +48,47 @@ public static class ToolsTime {
public static float TrialTime { get { return trialTime; } }
public static float TimeSinceTrialStarted { get { return timeSinceTrialStarted; } }
public static float DeltaTime { get { return deltaTime; } }
public static float RealDelatTime { get { return realDeltaTime; } }
public static float RealDeltaTime { get { return realDeltaTime; } }
public static void updateTime()
{
#if MIDDLEVR
realDeltaTime = isInPause ? 0 : (float)MiddleVR.VRKernel.GetDeltaTime();
#else
if(use_ros)
if(use_external)
{
realDeltaTime = ros_clock.DeltaTime;
if(realDeltaTime > 0)
float dt = realDeltaTime;
if(tcp_clock != null)
{
for(int i = 0; i < realDeltaTime/0.01f; i++)
Physics.Simulate(0.01f);
dt = tcp_clock.DeltaTime;
}
else if(ros_clock != null)
{
dt = ros_clock.DeltaTime;
}
realDeltaTime = dt;
Physics.Simulate(0.01f);
// if(realDeltaTime > 0)
// {
// // for(int i = 0; i < realDeltaTime/0.01f; i++)
// // Physics.Simulate(0.01f);
// }
}
else
realDeltaTime = Time.deltaTime;
#endif
timeSinceTrialStarted += realDeltaTime;
if(use_ros)
if(use_external)
{
absoluteTime = ros_clock.Time;
if(tcp_clock != null)
{
absoluteTime = tcp_clock.Time;
}
else if(ros_clock != null)
{
absoluteTime = ros_clock.Time;
}
}
else
{
......
......@@ -37,6 +37,7 @@ namespace RosSharp.RosBridgeClient
[HideInInspector]
public bool start_scripts = false;
public void Awake()
{
new Thread(ConnectAndWait).Start();
......@@ -46,7 +47,7 @@ namespace RosSharp.RosBridgeClient
private void ConnectAndWait()
{
RosSocket = ConnectToRos(Protocol, RosBridgeServerUrl, OnConnected, OnClosed);
if (!isConnected.WaitOne(Timeout * 1000))
Debug.LogWarning("Failed to connect to RosBridge at: " + RosBridgeServerUrl);
}
......@@ -102,5 +103,6 @@ namespace RosSharp.RosBridgeClient
isConnected.Reset();
Debug.Log("Disconnected from RosBridge: " + RosBridgeServerUrl);
}
}
}
\ No newline at end of file
File moved
fileFormatVersion: 2
guid: 7f6fb0d91e49bd856afde2dde299c27d
guid: e2cd78492fb397d868b298701023a4a6
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
fileFormatVersion: 2
guid: c4ea7feb8c58f2e1099e66e977832104
guid: a7257c609dac405a38d4c36a3093a119
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
fileFormatVersion: 2
guid: 5ae38f483c988f4a690fbc89a88e0c4a
guid: 8ddf27dada8b3ae2fa8b7ba6bd6452a2
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
fileFormatVersion: 2
guid: c9798f3e9655e9a75857516341a997bf
guid: d0fcffbfb88580a68b6d01108e31916f
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment