-
Notifications
You must be signed in to change notification settings - Fork 37
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
Slightly improved architecture of robot.yaml #177
Conversation
Hey @JanezCim Can you separate out the param changes from the other changes here? I think the flat parameters need more discussion, but the rest of this is pretty good. |
Hmm ok, I think it would be best that we continue discussion about the flat parameters here and I make a separate PR fixing the install rules. Why I made the flat params:
Bad things:
Comments? |
@rohbotics I implemented per-param correction and added launch checking (launch checking happenes only if --debug is added into command) Can you re-review and test if it works for you :) Thanks! |
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.
From what I've tested it out both the --debug and regular runs work without issues, and it handles the old yamls as it should.
I've had a few misgivings about a few things, but after thinking them through I mostly agree on how it's set up.
There's just one minor thing:
sonars: None
# sonars: 'pi_sonar_v1' # Use this to enable sonars
# We only support 1 version of the Sonars right now
if conf["sonars"] == "pi_sonar_v1":
conf["sonars"] = True
else:
conf["sonars"] = False
<group if="$(arg sonars_installed)">
<node pkg="pi_sonar" type="pi_sonar" name="pi_sonar"/>
</group>
This setup is somewhat inconsistent for either having sonars as a simple toggle, or for supporting multiple types. Either we go all the way and have it boolean in the yaml as well:
sonars: False
# sonars: True # Use this to enable sonars
Or we go the other way and support the string type in the launch file, so it's possible to add additional options without messing with the generation script:
<group if="$(eval arg('sonars') == 'pi_sonar_v1')">
<node pkg="pi_sonar" type="pi_sonar" name="pi_sonar"/>
</group>
<group if="$(eval arg('sonars') == 'pi_sonar_v2')">
<node pkg="pi_sonar_v2" type="pi_sonar_v2" name="pi_sonar_v2"/>
</group>
etc.
I assume we should also get rid of the unused legacy param/base.yaml file with this change right? If we leave it there it's become a possible sink for changes that won't be reflected anywhere and may generate confusion.
@MoffKalast nice catch! Yeah thinking about it, since we arent super key on deversifying the sonar types i'd change it to bool, what do you think @rohbotics ? We've decided not to get rid of base.yaml because its still kept for non-user editable "parameters" as mentioned in the design choices readme: https://github.com/UbiquityRobotics/magni_robot/tree/bugfix-oldrobotyaml/magni_bringup But yeah maybe it would be good just to delete the parameters that have now been moved to robot.yaml so we dont have duplication and dont confuse people. Would that be a good alternative @MoffKalast ? |
|
||
conf = get_yaml(conf_path, default_conf) | ||
# print out the whole config if in debug mode | ||
if arguments.debug == True: |
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.
Just a small thing - I don't understand why would you do this instead of if arguments.debug:
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.
I do this so its a smidge easier to read for humans
…ni_robot into bugfix-oldrobotyaml
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.
Seems good as it is right now, nothing really jumps out at me that I'd comment on, at least in a conceptual sense. We've discussed most parts already anyway. Now it just needs to be used by somebody for a bit to see if anything's amiss.
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.
I don't really understand what all new parameters are for, but looks good to me.
pid_control: 0 | ||
drive_type: "standard" | ||
wheel_type: "standard" | ||
wheel_gear_ratio: 4.294 |
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.
Very pleased that we have all of the following in here: pid_velocity as 0, drive_type as standard, wheel_gear_ratio as 4.294 AND even pid_control as 0! Thanks!
I feel strongly due to massive history we have with base.yaml that we should keep magni_bringup/param/base.yaml The file remains but only holds a comment that says 'All parameters have been moved to /etc/robot.yaml' I state this because we have COUNTLESS entries in forum, on learn pages and email threads and customers themselves holding notes that ALL discuss making changes to base.yaml file. If we keep base.yaml I guarentee you we save MASSIVE numbers of waste of time queries to us about confusion on base.yaml. |
I can agree with that. As long as there aren't any actual params left in it that would make it appear as an actual config file. |
That is correct. Absolutely no parameters in it, commented out or not. |
Yes that is a smart and easy thing to do. And then we can remove it sometime in the future |
I've added the follwing text:
|
Thank you for understanding the practical need for this file to help customers out of certain confusion for the customers who are following current docs. This leaving base.yaml is such an easy way to avoid I suspect a great many hours spent here and there over time to first realize what was wrong then tell them EXACTLY what would be great to state simply in that file. This is PURELY support. Sometimes the ideal 'keep it all clean' conflicts with backward compatible suportability, this is that case. Thanks |
- We decided to move many motor controller and other key operating mode parameters from base.yaml to robot.yaml. A lot of work was done to do this by Rohan but the issue has been only creeping along and needs closure so that it will finally be safe to use magni_robot repository along with ubiquity_motor and our main codeline will then be more supportable again. |
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.
This may likely be the MOST important fix of the entire change! ;-)
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.
Very important indeed :D
pid_proportional: 5000 | ||
pid_integral: 7 | ||
pid_integral: 5 |
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.
Nitpik: This 'could' be as low as 3 but lets just go with this to not slow down this extremely long awaited change. I checked kinetic-devel and noetic-devel and this is a mess so just leave this and we will do more evaluation and other things later. Never hack some number at the 11th hour, it breaks stuff. We ship only what we have tested.
"max_velocity": str(vc_ang["max_velocity"]), | ||
"has_acceleration_limits": str(vc_ang["has_acceleration_limits"]), | ||
"max_acceleration": str(vc_ang["max_acceleration"]), | ||
|
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.
Interesting use of this 'mot_cont' to make the reading here easier. Nice. I think that was pre-existing so I assume it works.
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.
It would also be extremely nice if someone told me they have tested this on their actual robots and it works. I have tested on mine, but you never know.
conf["sonars"] = False | ||
# print out the whole config if in debug mode | ||
if arguments.debug == True: | ||
print("DEUBG: Full content of the applied config:") |
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.
Cleanup: Is this really needed? This may be a debug artifact
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.
No, "debug" is parameter you can run the launch_core.py with to get some usefull info out of it. Usefull in the future
# get camera extrinsics | ||
path1 = ( | ||
"~/.ros/extrinsics/camera_extrinsics_%s.yaml" % conf["raspicam"]["position"] | ||
"~/.ros/extrinsics/camera_extrinsics_%s.yaml" % conf["raspicam_position"] |
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.
has somebody thought through this 'symantic' change? It only 'slightly' makes my 'spidy sense' thing that there is room for generation of a bug in this sort of synantic change.
This change MUST be tested by our test group. Please include a test in the test plan.
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.
Not tested with our test group yet.
If the user sets (kinetic way)
raspicam: {"position" : "forward"}
instead of (noetic way)
raspicam_position: 'forward'
The raspicam_position forward will be taken from src/magni_robot/magni_bringup/config/default_robot.yaml
thus making the robot not chrash, just the cam position will not be what user has set.
Maybe also here i could add a comment in /etc/ubiquity/robot.yaml
that the param has changed from raspicam: {"position" : "forward"}
to raspicam_position: 'forward'
. Same thing then needs to be done for lidar
I do not see myself as an official 'reviewer' but in this light, 'I Approve'. Thanks all |
IMPORTANT but SIMPLE: I think there are already a couple things such as raspicam position and so on that remind me that we really need at the very start of the default_robot.yaml file to have a comment line like this: File format 2.0If this is present we then can modify douments like the raspicam setup learn page and so on and say that if they see top of the file that the format is 2.0 or greater use these lines, else use older format lines. This is rather important frankly. Lets lower the impact of this change by outguessing obvious issues of the future. Thanks |
After todays test it seemed good to me. |
@mjstn i can do that, but long term id say that the way to go with these things would be that we have a documentation system that suppors the box through which the user can choose a version/distro of the documentation they would like to see. Eg. from readthedocs for ROS2: This would super simplify our documentations and make it a bit more future proof IMO - since you cant be forever adding cases for each new version to the same .md file |
I think this is ok for now, we will do a further iteration with more generic sensor handling. |
Changes in how core.launch gets generated and launched. Biggest change: base.yaml does not exsist any more, everything gets loaded through magni_bringup/config/default_robot.yaml -> launch_core.py -> generated_core.launch. This way the params from base.yaml are not duplicated and hopefully makes the whole process more clear.
Fixes #172
Fixes #169
on the rpi that runs noetic test with
python3 ~/catkin_ws/src/magni_robot/magni_bringup/scripts/launch_core.py --debug
when reviewing:
python3 ~/catkin_ws/src/magni_robot/magni_bringup/scripts/launch_core.py
which actually launches the generated_core.launch to see if everythig starts up as expected - try to move the robot around and stuff.