-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Added Zero Turn Lawnmower model #22717
Conversation
Hey I will take a look! Thanks for the contribution :). |
I updated .gitmodules and gz submodule to reflect latest changes there (pointed it to "main" in PX4/PX4-gazebo-models). @frede791 @dagar @PerFrivik - now when PX4/PX4-gazebo-models#27 is merged, this one needs a review and a push. |
@slgrobotics @dagar @PerFrivik The PX4/PX4-gazebo-models#27 PR has been merged so this is ready for review. |
Waiting for PX4/PX4-gazebo-models#30 to be completed. |
I will take a look at this on Friday (16.02). |
Seems to be working fine 👍, but I am wondering a bit about the servos, I did not quite understand what they are doing in the sim. Regarding the naming convention, I will talk with Matthias. Mission also works well. |
@PerFrivik - about the servos, I explained their function in this PR above and in the setup script comments. Let me know if this is not clear/sufficient. "Note: And when it comes to the sim, real lawnmowers have cutter decks and maybe other actuators, so the suggested sim configuration makes at least some available to users who will take DD Guidance code and will start modifying it to their needs. |
Hey @slgrobotics I was just a bit confused, because when I ran the sim only 2 servos showed up, but you mentioned 4 separate things that should be controlled that are not wheels. |
@PerFrivik - well, I wouldn't expect generic Differential Drive Guidance control output anything beyond the two wheels values. The servos/actuators are there:
Overall, planting a hint or example code in a component that serves as a baseline for future extension by users is a way to complement documentation (which is always lacking). To me, the goal of this PR is to contribute a useful model and to help you further debug/tune your Guidance control. I am fine with whatever changes make sense to the Team, no worries. |
To reiterate: I was not sure about naming logic in airframes folder, so 5005_gz_lawnmower can be changed to fit common practices. I think that having a 5* naming group for agricultural machines (or even all rovers) makes sense. Please come to an agreement and state the name you want here - I will do the renaming then. Thanks! |
@slgrobotics I will take another look at it today, then I think we would be ready to merge 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except the airframe number and a small comment for clarity, I think this is a nice addition to PX4!
I think if we want to change the convention, we should do it for all of them. |
@PerFrivik - I accepted your changes and did all the renaming. I also pulled the latest hash of gz_models (fixes the "pose>" issue in R1 model). The tree builds (as described initially). There's still unresolved issue #22767 - for testing just add back A couple pending PRs should not interfere with testing or merging - https://github.com/PX4/PX4-gazebo-models/pulls |
@slgrobotics perfect! I will approve this PR as soon as the CI is done running. |
BTW, I tried it in "Go There" mode, it seems to work. It starts moving very slowly, then accelerates OK, and when reaching the destination WP - moves around in "Hold" state. When running a mission, the rover turns well towards the waypoint, but fails to move. Here is a simple plan I used: |
Let me test and see what the issue is. |
Okay, so mission does work, the issue is that with my current waypoint logic, the rover needs to go below a certain angle threshold to start driving, but since the vehicle angular rate that gets commanded its proportional to the angle error, towards the end the rover gets quite slow. This is something I need to fix, maybe I can introduce a minimal angular rate for the turning state, I will think about it, thank you! Either way, this is unrelated to your PR and I think we can merge it now. |
Works all right
RDD_WHL_SPEED has new name: RDD_WHEEL_SPEED
Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com>
Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com>
also pulled latest GZ models hash
* Added Lawnmower airframe * Update 5005_gz_lawnmower Works all right * Update 5005_gz_lawnmower RDD_WHL_SPEED has new name: RDD_WHEEL_SPEED * Update ROMFS/px4fmu_common/init.d-posix/airframes/5005_gz_lawnmower Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com> * Update ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com> * Renamed 5005_gz_lawnmower to 4011_gz_lawnmower also pulled latest GZ models hash --------- Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com>
* Added Lawnmower airframe * Update 5005_gz_lawnmower Works all right * Update 5005_gz_lawnmower RDD_WHL_SPEED has new name: RDD_WHEEL_SPEED * Update ROMFS/px4fmu_common/init.d-posix/airframes/5005_gz_lawnmower Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com> * Update ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com> * Renamed 5005_gz_lawnmower to 4011_gz_lawnmower also pulled latest GZ models hash --------- Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com>
* Added Lawnmower airframe * Update 5005_gz_lawnmower Works all right * Update 5005_gz_lawnmower RDD_WHL_SPEED has new name: RDD_WHEEL_SPEED * Update ROMFS/px4fmu_common/init.d-posix/airframes/5005_gz_lawnmower Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com> * Update ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com> * Renamed 5005_gz_lawnmower to 4011_gz_lawnmower also pulled latest GZ models hash --------- Co-authored-by: Per Frivik <94360401+PerFrivik@users.noreply.github.com>
Solved Problem
This PR contributes full-size Zero Turm Lawnmower model to existing collection of Gazebo Ignition models. While crude visually, it tries to simulate masses, inertia and friction of an actual full-size machine.
Used Husqvarna Z254 dimensions.
This model works fine with current Differential Drive Controller (#22402) and my own fork (https://github.com/slgrobotics/PX4-Autopilot). It can be driven manually.
Please see PX4/PX4-gazebo-models#27 for actual SDF file
Testing:
You may need to repeat the "make" command twice, if the GZ SIM doesn't show the model (common problem)
At this point you can arm the robot in QGroundControl and drive it manually.
Note:
My robot has PCA9685 PWM driver and all functions are controlled now by directly publishing actuator_servos message. Wheels are 0 and 1, then goes cutter deck clutch (2), gas engine throttle (3), "mission strobe" (4), alarm horn (5) and two extra channels. Model works for me without any changes, as is, and is helpful in tuning and debugging.
I was not sure about naming logic in airframes folder, so 5005_gz_lawnmower can be changed to fit common practices. I think that having a 5* naming group for agricultural machines (or even all rovers) makes sense.
@dagar @PerFrivik - please take a look, as discussed earlier.