Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Follow Crop Navigation #103

Merged
merged 18 commits into from
Jul 30, 2024
Merged

Fixing Follow Crop Navigation #103

merged 18 commits into from
Jul 30, 2024

Conversation

LukasBaecker
Copy link
Contributor

@LukasBaecker LukasBaecker commented Jul 1, 2024

Due to multiple problems that arose using the follow crop navigation, it needs to be refactored.

ToDo:

  • writing tests for simulation
  • rethink the automation
  • fix code according to the tests
  • test the automation on a robot

rodja added a commit that referenced this pull request Jul 15, 2024
@rodja rodja mentioned this pull request Jul 15, 2024
4 tasks
@LukasBaecker LukasBaecker mentioned this pull request Jul 16, 2024
LukasBaecker added a commit that referenced this pull request Jul 17, 2024
* always use gray background color for simulated usb cam

* improve readability

* improve camera augmentation to display tool and relevant weeds

* fix plant filter which compared local and global coordinates

* also visualize "weeds to handle" from implement

* formatting

* remove obsolete "advancing" hack

* ensure we are not multi-punching the same position

* more debug rendering

* make weeds to handle visualization optional

* always use gray background color for simulated usb cam

* improve readability

* improve camera augmentation to display tool and relevant weeds

* fix plant filter which compared local and global coordinates

* also visualize "weeds to handle" from implement

* formatting

* remove obsolete "advancing" hack

* ensure we are not multi-punching the same position

* more debug rendering

* make weeds to handle visualization optional

* reorder camera_card init

* add type annotations

* use deque for last punches

* remove debug logging

* fix crop prediction

* do not use project_to_image on real robots
because the camera is not correctly transformed yet

* add a test for a real life scenario where the robot will not move

* fix non moving robot

* add max_crop_distance setting

* request backup on screw settings change

* add more test cases where weeding screw does not advance anymore

* improved readability

* fix weeding screw approach

* fix test weed position

* fix copy paste error

* fix cultivated_crop test

* add check for next_weed_id in weeds_to_handle

* Move _keep_crops_safe to _has_plants_to_handle

* add check for negative stretch distance

* adapt other navigations to changes

* move crop_safety_distance to weeding_implement

* fix weeding edge case

* wip: adapt tornado to changes

* drive backwards in test because its more efficient

* provide more debug infos in camera card

* move clearing of simulation and plant provider to navigation

* cleanup

* forgot member variable

* simulation after clearing

* get rid of "observe" and "parallel"

* dont remove simulated_objects in test to fix #9bfbc97

* make test more robust

* move last_punches and next_punch_y_position to weeding_implement

* wip: adapt tornado

* fix skipping weeds close to already punched locations

* fixed output formatting

* more weed separation to better target close standing plants individually

* fix last punches exclusion test

* fix tornado weed removal in simulation

* formatting

* wording

* move punch dialog into weeding implements to simplify architecture

* cleanup

Co-authored-by: Pascal Schade <165774906+pascalzauberzeug@users.noreply.github.com>

* cleanup

Co-authored-by: Pascal Schade <165774906+pascalzauberzeug@users.noreply.github.com>

* remove unused camera_card

* rename and move max parameter

* add default drive distance as constant

* cleanup

* first proof of sub-centimeter straight line driving

* use wheels.pose in simulation so we can simulate slippage with rosys pull request zauberzeug/rosys#146

* cleanup

* stay as good as possible on the once defined straight line
this was inspired by the works in #96 and makes that pull request obsolete

* picked relevant code from #103

* ordered tests

* better termination for straight line nav, rosys.sleep to fix flakyness and method split to prepare universal use

* better variable naming

* add test to ensure we can follow crops with slippage

* fix yaw computation and use "drive to yaw" when following crops

* fix tests

---------

Co-authored-by: Pascal Schade <pascal@zauberzeug.com>
Co-authored-by: Pascal Schade <165774906+pascalzauberzeug@users.noreply.github.com>
Co-authored-by: Lukas Baecker <baecker.lukas@outlook.de>
@rodja
Copy link
Member

rodja commented Jul 29, 2024

Should we close this PR @LukasBaecker?

@pascalzauberzeug
Copy link
Contributor

@LukasBaecker @rodja I think we can drop the changes, but should keep the tests!

@LukasBaecker LukasBaecker marked this pull request as ready for review July 30, 2024 13:33
@pascalzauberzeug pascalzauberzeug added this to the 0.2.0 milestone Jul 30, 2024
@pascalzauberzeug pascalzauberzeug added the enhancement New feature or request label Jul 30, 2024
@pascalzauberzeug pascalzauberzeug merged commit 2449b30 into main Jul 30, 2024
2 checks passed
@pascalzauberzeug pascalzauberzeug deleted the follow_crop_navigation branch July 30, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants