Autobots-Visman / segmentation

A ROS package that converts images into semantic messages for other systems
0 stars 0 forks source link

Add skeleton of packages with initial unit tests and docker configuration #1

Closed acmiyaguchi closed 1 year ago

acmiyaguchi commented 1 year ago

This adds two packages, object_detection and scene_graph. The object detection package is configured with a python package, and a test via pytest. We also configure a single dummy message that is compiled at build time. The tests just verify basic cv_bridge and msg publishing.

$ docker compose run app catkin test
Starting  >>> object_detection                                                                         
Starting  >>> scene_graph                                                                              
Output     << scene_graph:results /app/logs/scene_graph/test.results.000.log                           
Summary: 0 tests, 0 errors, 0 failures, 0 skipped
cd /app/build/scene_graph; catkin test --get-env scene_graph | catkin env -si  catkin_test_results; cd -

Finished  <<< scene_graph               [ 0.3 seconds ]                                                
...
[Testcase: testtest_detect] ... ok

[ROSTEST]-----------------------------------------------------------------------

[object_detection.rosunit-test_detect/test_recieve_image_mock][passed]
[object_detection.rosunit-test_detect/test_msg_detected_object_list][passed]
[object_detection.rosunit-test_detect/test_msg_detected_object_list_publish][passed]

SUMMARY
 * RESULT: SUCCESS
 * TESTS: 3
 * ERRORS: 0
 * FAILURES: 0
rostest log file is in /root/.ros/log/rostest-autobots-vm-127.log
cd /app/build/object_detection; catkin test --get-env object_detection | catkin env -si  /usr/bin/make run_tests; cd -

Output     << object_detection:results /app/logs/object_detection/test.results.000.log                 
Summary: 4 tests, 0 errors, 0 failures, 0 skipped
cd /app/build/object_detection; catkin test --get-env object_detection | catkin env -si  catkin_test_results; cd -

Finished  <<< object_detection          [ 3.2 seconds ]                                                
[test] Summary: All 2 packages succeeded!                                                              
[test]   Ignored:   None.                                                                              
[test]   Warnings:  None.                                                                              
[test]   Abandoned: None.                                                                              
[test]   Failed:    None.                                                                              
[test] Runtime: 3.2 seconds total.  

There are a few notable oddities to consider here:

I think the next thing we should add is yolov8, and to wrap that functionality into a sane "perceiver" (which may be a better name for the object_detection package). We should use a requirements.txt at the package root to specify the dependencies, because ROS does not support the wider pip ecosystem. Thus, we need to rely on external methods to get interesting python packages into the package.