Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bioroboticslab
robofish
io
Commits
a07a5180
Commit
a07a5180
authored
4 years ago
by
Andi Gerken
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop_marc' into develop
parents
7f07029f
a2cca45d
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/conversion_scripts/convert_marc.py
+30
-0
30 additions, 0 deletions
src/conversion_scripts/convert_marc.py
src/robofish/evaluate/evaluate.py
+367
-159
367 additions, 159 deletions
src/robofish/evaluate/evaluate.py
with
397 additions
and
159 deletions
src/conversion_scripts/convert_marc.py
0 → 100644
+
30
−
0
View file @
a07a5180
import
pandas
as
pd
import
numpy
as
np
import
robofish.io
def
convertTrajectory
(
path
,
save_path
):
ar
=
pd
.
read_csv
(
path
,
sep
=
"
;
"
).
to_numpy
()
new
=
robofish
.
io
.
File
(
world_size
=
[
100
,
100
])
# convert orientation from radians to orientation vector
ori_vec
=
np
.
array
([
np
.
cos
(
ar
[:,
2
]),
np
.
sin
(
ar
[:,
2
])]).
T
print
(
ori_vec
.
shape
)
# get new trajectory with x, y, ori_x, ori_y
temp
=
np
.
append
(
ar
[:,
[
0
,
1
]],
ori_vec
,
axis
=
1
)
print
(
temp
.
shape
)
# convert x,y from m to cm
temp
[:,
[
0
,
1
]]
=
temp
[:,
[
0
,
1
]]
*
100
new
.
create_single_entity
(
type_
=
"
fish
"
,
name
=
"
fish_1
"
,
poses
=
temp
,
monotonic_step
=
50
)
# convert orientation from radians to orientation vector
ori_vec
=
np
.
array
([
np
.
cos
(
ar
[:,
5
]),
np
.
sin
(
ar
[:,
5
])]).
T
# get new trajectory with x, y, ori_x, ori_y
temp
=
np
.
append
(
ar
[:,
[
3
,
4
]],
ori_vec
,
axis
=
1
)
# convert x,y from m to cm
temp
[:,
[
0
,
1
]]
=
temp
[:,
[
0
,
1
]]
*
100
new
.
create_single_entity
(
type_
=
"
fish
"
,
name
=
"
fish_2
"
,
poses
=
temp
,
monotonic_step
=
50
)
new
.
validate
()
new
.
save
(
save_path
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/robofish/evaluate/evaluate.py
+
367
−
159
View file @
a07a5180
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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