Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CoLo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Shengkang (William) Chen
CoLo
Commits
c29b115b
Commit
c29b115b
authored
5 years ago
by
oceanpdoshi@g.ucla.edu
Browse files
Options
Downloads
Patches
Plain Diff
some comments, changed < to <=
avoids cropping off time at the end of sim
parent
66cc2c21
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CoLo-AT/dataset_manager/data_generator.py
+3
-3
3 additions, 3 deletions
CoLo-AT/dataset_manager/data_generator.py
CoLo-AT/dataset_manager/simulated_dataset_manager.py
+3
-6
3 additions, 6 deletions
CoLo-AT/dataset_manager/simulated_dataset_manager.py
with
6 additions
and
9 deletions
CoLo-AT/dataset_manager/data_generator.py
+
3
−
3
View file @
c29b115b
...
...
@@ -4,7 +4,7 @@ import matplotlib.pyplot as plt
import
IPython
# TODO - add collision checking for circle/random data
class
DataGenerator
():
def
__init__
(
self
,
landmarks
,
duration
,
robot_labels
,
starting_states
,
start_time
,
delta_t
,
velocity_noise
=
0
,
angular_velocity_noise
=
0
,
measurement_range_noise
=
0
,
bearing_noise
=
0
,
communication_noise
=
0
,
...
...
@@ -87,7 +87,7 @@ class DataGenerator():
# Generates simulated of robots moving in a circle
def
generate_circular_data
(
self
,
test
,
velocity
=
0.1
,
velocity_spread
=
0
):
radian_step
=
2
*
pi
/
self
.
duration
radian_step
=
2
*
pi
/
self
.
duration
# can be hardcoded to be a certain amount of degrees (radians)
# if it's a "perfect" circle, then velocity spread will be 0
distance_step
=
(
velocity
+
np
.
random
.
normal
(
0
,
velocity_spread
))
*
self
.
delta_t
...
...
@@ -111,7 +111,7 @@ class DataGenerator():
self
.
groundtruth_data
[
i
].
append
({
'
time
'
:
self
.
time_arr
[
'
groundtruth
'
][
i
][
time_idx
],
'
x_pos
'
:
next_x
,
'
y_pos
'
:
next_y
,
'
orientation
'
:
next_orientation
})
self
.
generate_odometry_data
()
self
.
generate_measurement_data
()
...
...
This diff is collapsed.
Click to expand it.
CoLo-AT/dataset_manager/simulated_dataset_manager.py
+
3
−
6
View file @
c29b115b
...
...
@@ -23,7 +23,6 @@ def find_nearest_time_idx(l, value):
# TODO
# communication
# scheduling
class
SimulatedDataSetManager
:
def
__init__
(
self
,
dataset_name
,
landmarks
,
duration
,
robot_labels
,
...
...
@@ -42,7 +41,7 @@ class SimulatedDataSetManager:
self
.
curr_request
=
'
odometry
'
self
.
curr_robot_idx
=
0
# time step of the simulation (secs)
TODO - user specified
# time step of the simulation (secs)
self
.
delta_t
=
delta_t
# landmarks = {landmark ID: [x,y]} (m)
...
...
@@ -52,7 +51,7 @@ class SimulatedDataSetManager:
raise
Exception
(
"
Invalid landmark ID: landmark IDs must be bigger than 5.
"
)
# starting_states = {robot label: [time, x_pos, y_pos, orientation], ... }
# TODO - create a generate starting states function
(potentially randomized to fit boundary)
# TODO - create a generate starting states function
self
.
starting_states
=
{
label
:
[
self
.
start_time
,
i
,
0
,
0.0
]
for
i
,
label
in
enumerate
(
self
.
robot_labels
)}
# groundtruth & odometry are of fixed length=duration
...
...
@@ -127,8 +126,6 @@ class SimulatedDataSetManager:
req
.
set_message
(
message
)
req
.
set_type
(
req_type
)
# TODO - perhaps this is the sourceo f the issue?
if
(
req_type
==
'
measurement
'
and
self
.
reset_robot_ctr
()):
current_time
+=
self
.
delta_t
...
...
@@ -159,7 +156,7 @@ class SimulatedDataSetManager:
message
[
'
robot_index
'
]
=
robot_idx
# Past the total time of simulation or no further measurements
valid_dataline
=
current_time
<
self
.
end_time
or
(
abs
(
current_time
-
self
.
end_time
)
<
0.001
)
# <= w/floats
valid_dataline
=
current_time
<
=
self
.
end_time
or
(
abs
(
current_time
-
self
.
end_time
)
<
0.001
)
# <= w/floats
# Select message data
if
valid_dataline
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment