Skip to content

Commit d15cffc

Browse files
Franco Guidicassava
Franco Guidi
authored andcommitted
minimator: Add new schema for minimator
- Create a basic EgoSensor and object sensor. - Add new schema to configure position and velocity of Ego and traffic object. - Adapt world object and minimator vehicle class accordingly.
1 parent b13c718 commit d15cffc

11 files changed

+864
-117
lines changed

plugins/gndtruth_extractor/tests/config_minimator_smoketest.json

+30-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,43 @@
55
],
66
"simulators": [
77
{
8-
"binding": "minimator"
8+
"binding": "minimator",
9+
"args": {
10+
"vehicles": {
11+
"ego1": {
12+
"ego_sensor_mockup": {
13+
"ego_object": {
14+
"velocity": 20.0,
15+
"position": {
16+
"x": 0.0,
17+
"y": 0.0,
18+
"z": 0.0
19+
}
20+
}
21+
},
22+
"object_sensor_mockup": {
23+
"objects": [
24+
{
25+
"velocity": 0.0,
26+
"position": {
27+
"x": 10.0,
28+
"y": 0.0,
29+
"z": 0.0
30+
}
31+
}
32+
]
33+
}
34+
}
35+
}
36+
}
937
}
1038
],
1139
"vehicles": [
1240
{
1341
"name": "default",
1442
"from": {
1543
"simulator": "minimator",
16-
"index": 0
44+
"name": "ego1"
1745
}
1846
}
1947
],

plugins/gndtruth_extractor/tests/test_gndtruth_smoketest_output.json

+192-8
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,54 @@
2525
"z": 0.0
2626
}
2727
},
28-
"name": "nop_object_sensor",
29-
"sensed_objects": []
28+
"name": "minimator_object_sensor",
29+
"sensed_objects": [
30+
{
31+
"acceleration": {
32+
"x": 0.0,
33+
"y": 0.0,
34+
"z": 0.0
35+
},
36+
"angular_velocity": {
37+
"x": 0.0,
38+
"y": 0.0,
39+
"z": 0.0
40+
},
41+
"class": "unknown",
42+
"cog_offset": {
43+
"x": 0.0,
44+
"y": 0.0,
45+
"z": 0.0
46+
},
47+
"dimensions": {
48+
"x": 5.0,
49+
"y": 2.0,
50+
"z": 1.8
51+
},
52+
"exist_prob": 1.0,
53+
"id": 0,
54+
"pose": {
55+
"rotation": {
56+
"w": 1.0,
57+
"x": 0.0,
58+
"y": 0.0,
59+
"z": 0.0
60+
},
61+
"translation": {
62+
"x": 10.0,
63+
"y": 0.0,
64+
"z": 0.0
65+
}
66+
},
67+
"type": "unknown",
68+
"velocity": {
69+
"x": 0.0,
70+
"y": 0.0,
71+
"z": 0.0
72+
},
73+
"velocity_norm": 0.0
74+
}
75+
]
3076
},
3177
"cloe::gndtruth_lane_sensor": {
3278
"frustum": {
@@ -188,8 +234,54 @@
188234
"z": 0.0
189235
}
190236
},
191-
"name": "nop_object_sensor",
192-
"sensed_objects": []
237+
"name": "minimator_object_sensor",
238+
"sensed_objects": [
239+
{
240+
"acceleration": {
241+
"x": 0.0,
242+
"y": 0.0,
243+
"z": 0.0
244+
},
245+
"angular_velocity": {
246+
"x": 0.0,
247+
"y": 0.0,
248+
"z": 0.0
249+
},
250+
"class": "unknown",
251+
"cog_offset": {
252+
"x": 0.0,
253+
"y": 0.0,
254+
"z": 0.0
255+
},
256+
"dimensions": {
257+
"x": 5.0,
258+
"y": 2.0,
259+
"z": 1.8
260+
},
261+
"exist_prob": 1.0,
262+
"id": 0,
263+
"pose": {
264+
"rotation": {
265+
"w": 1.0,
266+
"x": 0.0,
267+
"y": 0.0,
268+
"z": 0.0
269+
},
270+
"translation": {
271+
"x": 10.0,
272+
"y": 0.0,
273+
"z": 0.0
274+
}
275+
},
276+
"type": "unknown",
277+
"velocity": {
278+
"x": 0.0,
279+
"y": 0.0,
280+
"z": 0.0
281+
},
282+
"velocity_norm": 0.0
283+
}
284+
]
193285
},
194286
"cloe::gndtruth_lane_sensor": {
195287
"frustum": {
@@ -351,8 +443,54 @@
351443
"z": 0.0
352444
}
353445
},
354-
"name": "nop_object_sensor",
355-
"sensed_objects": []
446+
"name": "minimator_object_sensor",
447+
"sensed_objects": [
448+
{
449+
"acceleration": {
450+
"x": 0.0,
451+
"y": 0.0,
452+
"z": 0.0
453+
},
454+
"angular_velocity": {
455+
"x": 0.0,
456+
"y": 0.0,
457+
"z": 0.0
458+
},
459+
"class": "unknown",
460+
"cog_offset": {
461+
"x": 0.0,
462+
"y": 0.0,
463+
"z": 0.0
464+
},
465+
"dimensions": {
466+
"x": 5.0,
467+
"y": 2.0,
468+
"z": 1.8
469+
},
470+
"exist_prob": 1.0,
471+
"id": 0,
472+
"pose": {
473+
"rotation": {
474+
"w": 1.0,
475+
"x": 0.0,
476+
"y": 0.0,
477+
"z": 0.0
478+
},
479+
"translation": {
480+
"x": 10.0,
481+
"y": 0.0,
482+
"z": 0.0
483+
}
484+
},
485+
"type": "unknown",
486+
"velocity": {
487+
"x": 0.0,
488+
"y": 0.0,
489+
"z": 0.0
490+
},
491+
"velocity_norm": 0.0
492+
}
493+
]
356494
},
357495
"cloe::gndtruth_lane_sensor": {
358496
"frustum": {
@@ -514,8 +652,54 @@
514652
"z": 0.0
515653
}
516654
},
517-
"name": "nop_object_sensor",
518-
"sensed_objects": []
655+
"name": "minimator_object_sensor",
656+
"sensed_objects": [
657+
{
658+
"acceleration": {
659+
"x": 0.0,
660+
"y": 0.0,
661+
"z": 0.0
662+
},
663+
"angular_velocity": {
664+
"x": 0.0,
665+
"y": 0.0,
666+
"z": 0.0
667+
},
668+
"class": "unknown",
669+
"cog_offset": {
670+
"x": 0.0,
671+
"y": 0.0,
672+
"z": 0.0
673+
},
674+
"dimensions": {
675+
"x": 5.0,
676+
"y": 2.0,
677+
"z": 1.8
678+
},
679+
"exist_prob": 1.0,
680+
"id": 0,
681+
"pose": {
682+
"rotation": {
683+
"w": 1.0,
684+
"x": 0.0,
685+
"y": 0.0,
686+
"z": 0.0
687+
},
688+
"translation": {
689+
"x": 10.0,
690+
"y": 0.0,
691+
"z": 0.0
692+
}
693+
},
694+
"type": "unknown",
695+
"velocity": {
696+
"x": 0.0,
697+
"y": 0.0,
698+
"z": 0.0
699+
},
700+
"velocity_norm": 0.0
701+
}
702+
]
519703
},
520704
"cloe::gndtruth_lane_sensor": {
521705
"frustum": {
Binary file not shown.

plugins/minimator/CMakeLists.txt

+28
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,37 @@ include(CloePluginSetup)
99
cloe_add_plugin(
1010
TARGET ${PROJECT_NAME}
1111
OUTPUT_NAME simulator_minimator
12+
INCLUDE_DIRECTORIES
13+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
1214
SOURCES
1315
src/minimator.cpp
1416
LINK_LIBRARIES
1517
cloe::runtime
1618
cloe::models
1719
)
20+
21+
include(CTest)
22+
if(BUILD_TESTING)
23+
find_package(GTest REQUIRED)
24+
include(GoogleTest)
25+
26+
set(test-minimator test-${PROJECT_NAME})
27+
add_executable(${test-minimator}
28+
src/minimator_config_test.cpp
29+
)
30+
target_include_directories(${test-minimator}
31+
PUBLIC
32+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
33+
)
34+
set_target_properties(${test-minimator} PROPERTIES
35+
CXX_STANDARD 17
36+
CXX_STANDARD_REQUIRED ON
37+
)
38+
target_link_libraries(${test-minimator}
39+
GTest::gtest
40+
GTest::gtest_main
41+
cloe::runtime
42+
cloe::models
43+
)
44+
gtest_add_tests(TARGET ${test-minimator})
45+
endif()

plugins/minimator/conanfile.py

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class CloeSimulatorMinimator(ConanFile):
2525
generators = "CMakeDeps", "VirtualRunEnv"
2626
no_copy_source = True
2727
exports_sources = [
28+
"include/*",
2829
"src/*",
2930
"CMakeLists.txt",
3031
]
@@ -60,6 +61,8 @@ def build(self):
6061
cm.configure()
6162
if self.should_build:
6263
cm.build()
64+
if self.should_test:
65+
cm.test()
6366

6467
def package(self):
6568
cm = cmake.CMake(self)

0 commit comments

Comments
 (0)