Skip to content

Commit

Permalink
Code cleanup in Devices
Browse files Browse the repository at this point in the history
- IMU
- Lidar
  • Loading branch information
hyunseok-yang committed Aug 14, 2020
1 parent 9f9f6fa commit bbf3e02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Assets/Scripts/Devices/IMU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

using System.Collections;
using UnityEngine;
using Stopwatch = System.Diagnostics.Stopwatch;
using messages = gazebo.msgs;

namespace SensorDevices
Expand Down Expand Up @@ -86,14 +85,11 @@ void FixedUpdate()

protected override IEnumerator MainDeviceWorker()
{
var sw = new Stopwatch();
var waitForSeconds = new WaitForSeconds(UpdatePeriod);
while (true)
{
sw.Restart();
GenerateMessage();
sw.Stop();

yield return new WaitForSeconds(WaitPeriod((float)sw.Elapsed.TotalSeconds));
yield return waitForSeconds;
}
}

Expand Down
1 change: 0 additions & 1 deletion Assets/Scripts/Devices/Lidar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ private IEnumerator LaserCameraWorker()

protected override IEnumerator MainDeviceWorker()
{
// var waitForSeconds = new WaitForSeconds(UpdatePeriod * adjustCapturingRate);
var sw = new Stopwatch();
while (true)
{
Expand Down

0 comments on commit bbf3e02

Please sign in to comment.