From c99fc8369deaaab25b45f4642bee5b6de0c85e6e Mon Sep 17 00:00:00 2001 From: Jonathan Spraggett Date: Fri, 20 Sep 2024 13:20:13 -0400 Subject: [PATCH] Js nav (#893) * found foot steps to vis and a source of odometry but really not accurate * Added fake localization to the rosversion for webots, will not work in reallife, i could hard code it to 0. renamed walk engine to navagator. some clean up in footstep planner. reworked walk_engine/ navigator to use both time or position as a goal for walking. tuned pid for pybullet and webots for accurate navigation to goal and changing the vel cmd for walking. Tested and verified in webots and pybullet need some cleaning for modularity * added head tracking, a bit buggy needs to be close enough and within a cone. Added a relative ball pose. Added tracking a point in the relative frame for navigation. Figured out that going faster sometimes fixes the problem. Added yaw control. Nearly there just need to put it together * added more dependcy * fixed rotatating goal problem: * minor bug fix * tried an experiment when i give placo the joint states and the Imu to see if it was better and got mixed results. fixed req.txt * moved the requirments into its own folder with files for gpu and a list of ros packages needed. got rid of the protobuf generation because it was breaking the build. added new services and made the cuda more modular. reorganized the dockerfile so that it doesnt take that long to rebuild by putting putting the update code base much later in the process. Made it multi stage and segmented the long downloads into its own stage. Also added a symlink so that we can use the docker compose as an interpreter * optimized the dockerfile by having different copy depending on which file in tools/setup is changed so we dont have to run all of it again. Also converted the list of packages into the rosdep.txt. Fixed the cmake protobuf problem by giving the USER ownership of the code. Removed yolov5 in external it is not used. Started integrating better docker project structure for the misc tools like docker and generic setup. made the compose more of a global folder that extends the docker in the tools folder. Moved dockerfile to the docker folder. --- .dockerignore | 8 +- .github/workflows/docker_image.yml | 2 +- .github/workflows/docker_image_arm.yml | 2 +- .github/workflows/docker_image_no_cuda.yml | 4 +- .gitignore | 4 +- .gitmodules | 3 - .idea/.gitignore | 8 - .idea/codeStyles/Project.xml | 18 +- .idea/codeStyles/codeStyleConfig.xml | 2 +- .idea/deployment.xml | 57 -- .idea/inspectionProfiles/Project_Default.xml | 68 +- .../inspectionProfiles/profiles_settings.xml | 2 +- .idea/jupyter-settings.xml | 17 - .idea/libraries/ROS.xml | 7 - .idea/libraries/workspace.xml | 7 - .idea/misc.xml | 8 +- .idea/other.xml | 7 - .idea/remote-mappings.xml | 18 +- .idea/ros.xml | 12 - ...ycontrol_test_test_walking_TestWalking.xml | 18 - ...ing_TestWalking_test_imu_feedback_real.xml | 18 - ...ing_TestWalking_test_walk_1_real_robot.xml | 18 - ...c_soccer_localization_test_test_simple.xml | 17 - ...r_soccer_msgs_test_game_engine_2d_Test.xml | 17 - ...t_detection_test_test_object_detection.xml | 18 - ..._detection_test_test_object_detection2.xml | 21 - ..._detection_test_test_object_detection3.xml | 21 - ...ctDetection_test_object_detection_node.xml | 21 - ...lization_test_test_object_localization.xml | 21 - ...ctLocalization_test_goalpost_detection.xml | 21 - ...TestObjectLocalization_test_hsv_filter.xml | 21 - ...bjectLocalization_test_robot_detection.xml | 21 - ...t_test_game_engine_2d_TestGameEngine2D.xml | 18 - ...eEngine2D_test_dummy_vs_dummy_strategy.xml | 18 - .../Python_tests_for_soccer_trajectories.xml | 22 - .../Python_tests_for_soccer_trajectories2.xml | 22 - ...sts_for_soccer_trajectories_trajectory.xml | 18 - ...ts_for_soccer_trajectories_trajectory2.xml | 18 - ...stWalking_test_obtain_calibration_bez1.xml | 18 - ...IntegrationTestInitial_test_game_start.xml | 17 - ...egrationTestPlaying_test_annotate_ball.xml | 20 - ...tegrationTestPlaying_test_annotate_net.xml | 20 - ...IntegrationTestPlaying_test_kick_right.xml | 17 - ...t_localization_test_freehicle_movement.xml | 17 - .idea/runConfigurations/Single_Simulation.xml | 19 - ...r_soccer_msgs_test_game_engine_2d_Test.xml | 59 -- ...s_for_test_integration_IntegrationTest.xml | 20 - .idea/runConfigurations/main.xml | 24 - .../pytest_for_soccer_trajectories.xml | 22 - .../runConfigurations/pytest_in_soccerbot.xml | 22 - .idea/runConfigurations/train.xml | 24 - .idea/soccerbot.iml | 30 +- .idea/soccerbot2.iml | 0 .idea/sshConfigs.xml | 10 - .idea/vcs.xml | 3 +- .idea/webServers.xml | 37 - compose.yaml | 116 +-- external/yolov5 | 1 - pyproject.toml | 15 +- requirements.txt | 44 -- .../soccer_pycontrol/config/bez1/bez1.yaml | 6 +- .../config/bez1/bez1_sim.yaml | 10 +- .../config/bez1/bez1_sim_pybullet.yaml | 8 +- .../config/bez2/bez2_sim_pybullet.yaml | 2 +- .../soccer_pycontrol/doc/ClassDiagrams.md | 10 +- soccer_control/soccer_pycontrol/doc/README.md | 2 +- .../soccer_pycontrol/exp/placo_joint_tasks.py | 65 +- .../src/soccer_pycontrol/main.py | 4 +- .../model/model_ros/sensors_ros.py | 37 + .../src/soccer_pycontrol/model/sensors.py | 3 + .../walk_engine/foot_step_planner.py | 64 +- .../soccer_pycontrol/walk_engine/navigator.py | 265 +++++++ .../walk_engine/walk_engine.py | 70 -- .../{walk_engine_ros.py => navigator_ros.py} | 34 +- .../soccer_pycontrol/test/test_placo.py | 28 +- .../soccer_pycontrol/test/test_pybullet.py | 2 +- .../test/test_pybullet_walk.py | 10 +- .../soccer_pycontrol/test/test_walk_ros.py | 33 +- .../src/soccer_localization/field.py | 1 + Dockerfile => tools/docker/Dockerfile | 85 +- tools/docker/compose.autonomy.yaml | 67 ++ tools/docker/compose.autonomy_arm64.yaml | 76 ++ tools/docker/compose.simulation.yaml | 37 + tools/docker/compose.testing.yaml | 40 + .../docker/docker-compose.dual.yaml | 0 .../docker/docker-compose.full.yaml | 0 .../docker-compose.game_controller.yaml | 0 .../docker/docker-compose.override.yaml | 0 .../docker/docker-compose.robot.yaml | 2 +- .../docker/docker-compose.test.kick.yaml | 0 .../docker/docker-compose.test.yaml | 2 +- tools/setup/requirements-gpu.txt | 34 + tools/setup/requirements.txt | 747 ++++++++++++++++++ tools/setup/rosdep.txt | 60 ++ 94 files changed, 1710 insertions(+), 1272 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/deployment.xml delete mode 100644 .idea/jupyter-settings.xml delete mode 100644 .idea/libraries/ROS.xml delete mode 100644 .idea/libraries/workspace.xml delete mode 100644 .idea/other.xml delete mode 100644 .idea/ros.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_control_soccer_pycontrol_test_test_walking_TestWalking.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_control_soccer_pycontrol_test_test_walking_TestWalking_test_imu_feedback_real.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_control_soccer_pycontrol_test_test_walking_TestWalking_test_walk_1_real_robot.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_localization_src_soccer_localization_test_test_simple.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_msgs_test_game_engine_2d_Test.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_perception_soccer_object_detection_test_test_object_detection.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_perception_soccer_object_detection_test_test_object_detection2.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_perception_soccer_object_detection_test_test_object_detection3.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_perception_soccer_object_detection_test_test_object_detection_TestObjectDetection_test_object_detection_node.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_perception_soccer_object_localization_test_test_object_localization.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_perception_soccer_object_localization_test_test_object_localization_TestObjectLocalization_test_goalpost_detection.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_perception_soccer_object_localization_test_test_object_localization_TestObjectLocalization_test_hsv_filter.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_perception_soccer_object_localization_test_test_object_localization_TestObjectLocalization_test_robot_detection.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_strategy_test_test_game_engine_2d_TestGameEngine2D.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_strategy_test_test_game_engine_2d_TestGameEngine2D_test_dummy_vs_dummy_strategy.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_trajectories.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_trajectories2.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_trajectories_trajectory.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_soccer_trajectories_trajectory2.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_test_calibration_TestWalking_test_obtain_calibration_bez1.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_test_integration_IntegrationTestInitial_test_game_start.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_test_integration_IntegrationTestPlaying_test_annotate_ball.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_test_integration_IntegrationTestPlaying_test_annotate_net.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_test_integration_IntegrationTestPlaying_test_kick_right.xml delete mode 100644 .idea/runConfigurations/Python_tests_for_test_localization_test_freehicle_movement.xml delete mode 100644 .idea/runConfigurations/Single_Simulation.xml delete mode 100644 .idea/runConfigurations/Unittests_for_soccer_msgs_test_game_engine_2d_Test.xml delete mode 100644 .idea/runConfigurations/Unittests_for_test_integration_IntegrationTest.xml delete mode 100644 .idea/runConfigurations/main.xml delete mode 100644 .idea/runConfigurations/pytest_for_soccer_trajectories.xml delete mode 100644 .idea/runConfigurations/pytest_in_soccerbot.xml delete mode 100644 .idea/runConfigurations/train.xml delete mode 100644 .idea/soccerbot2.iml delete mode 100644 .idea/sshConfigs.xml delete mode 100644 .idea/webServers.xml delete mode 160000 external/yolov5 delete mode 100644 requirements.txt create mode 100644 soccer_control/soccer_pycontrol/src/soccer_pycontrol/walk_engine/navigator.py delete mode 100644 soccer_control/soccer_pycontrol/src/soccer_pycontrol/walk_engine/walk_engine.py rename soccer_control/soccer_pycontrol/src/soccer_pycontrol/walk_engine/walk_engine_ros/{walk_engine_ros.py => navigator_ros.py} (61%) rename Dockerfile => tools/docker/Dockerfile (69%) create mode 100644 tools/docker/compose.autonomy.yaml create mode 100644 tools/docker/compose.autonomy_arm64.yaml create mode 100644 tools/docker/compose.simulation.yaml create mode 100644 tools/docker/compose.testing.yaml rename docker-compose.dual.yaml => tools/docker/docker-compose.dual.yaml (100%) rename docker-compose.full.yaml => tools/docker/docker-compose.full.yaml (100%) rename docker-compose.game_controller.yaml => tools/docker/docker-compose.game_controller.yaml (100%) rename docker-compose.override.yaml => tools/docker/docker-compose.override.yaml (100%) rename docker-compose.robot.yaml => tools/docker/docker-compose.robot.yaml (99%) rename docker-compose.test.kick.yaml => tools/docker/docker-compose.test.kick.yaml (100%) rename docker-compose.test.yaml => tools/docker/docker-compose.test.yaml (99%) create mode 100644 tools/setup/requirements-gpu.txt create mode 100644 tools/setup/requirements.txt create mode 100644 tools/setup/rosdep.txt diff --git a/.dockerignore b/.dockerignore index 6adaed3e3..87faeb72a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,10 +15,10 @@ docker-compose.* bez1_description/meshes/*.stl bez2_description/meshes/*.stl soccer_fieldline_detection/media -soccerbot/bags/* +#soccerbot/bags/* !soccerbot/bags/*.sh LICENSE venv/ -*.webm -soccer_perception/data/images/* -soccer_perception/data/videos/* +#*.webm +#soccer_perception/data/images/* +#soccer_perception/data/videos/* diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml index 047f1d452..7a68f9076 100644 --- a/.github/workflows/docker_image.yml +++ b/.github/workflows/docker_image.yml @@ -72,7 +72,7 @@ jobs: with: context: . push: true - file: Dockerfile + file: tools/docker/Dockerfile build-args: | INSTALL_CUDA=true tags: utrarobosoccer/soccerbot diff --git a/.github/workflows/docker_image_arm.yml b/.github/workflows/docker_image_arm.yml index 05d4c45fd..0a0785199 100644 --- a/.github/workflows/docker_image_arm.yml +++ b/.github/workflows/docker_image_arm.yml @@ -53,7 +53,7 @@ jobs: with: context: . push: true - file: Dockerfile + file: tools/docker/Dockerfile platforms: linux/arm64 tags: utrarobosoccer/soccerbot:arm64 cache-from: type=registry,ref=utrarobosoccer/soccerbot:arm64 diff --git a/.github/workflows/docker_image_no_cuda.yml b/.github/workflows/docker_image_no_cuda.yml index 65f7d40d4..8eb1582f3 100644 --- a/.github/workflows/docker_image_no_cuda.yml +++ b/.github/workflows/docker_image_no_cuda.yml @@ -44,9 +44,9 @@ jobs: with: context: . push: true - file: Dockerfile + file: tools/docker/Dockerfile build-args: | INSTALL_CUDA=false tags: utrarobosoccer/soccerbot:no_cuda - cache-from: type=registry,ref=utrarobosoccer/soccerbot + cache-from: type=registry,ref=utrarobosoccer/soccerbot:no_cuda cache-to: type=inline diff --git a/.gitignore b/.gitignore index 599facc77..e3305e30f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ # Python compiled files __pycache__/ *.pyc - +.idea/ # webots cache files soccer_webots/protos/*.cache soccer_webots/protos/Soccerbot_meshes/*.cache @@ -34,5 +34,3 @@ venv/ .mypy_cache/ cuda-ubuntu2004.pin.1 *.webm - -.idea/ diff --git a/.gitmodules b/.gitmodules index 636d754e3..4fafdf74c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,9 +8,6 @@ [submodule "soccer_strategy/src/game_controller/RobocupProtocol"] path = soccer_strategy/src/game_controller/RobocupProtocol url = git@github.com:utra-robosoccer/RobocupProtocol.git -[submodule "external/yolov5"] - path = external/yolov5 - url = git@github.com:utra-robosoccer/yolov5.git [submodule "external/hlvs_webots"] path = external/hlvs_webots url = git@github.com:utra-robosoccer/hlvs_webots.git diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 73f69e095..000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 76e3f6af2..3e22f4b71 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -2,7 +2,6 @@ - + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml index 0f7bc519d..79ee123c2 100644 --- a/.idea/codeStyles/codeStyleConfig.xml +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -2,4 +2,4 @@ - + \ No newline at end of file diff --git a/.idea/deployment.xml b/.idea/deployment.xml deleted file mode 100644 index fe490b533..000000000 --- a/.idea/deployment.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 756299869..a86eb75c1 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,21 +1,69 @@ - + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml index cc5462daf..105ce2da2 100644 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -3,4 +3,4 @@