-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add ICAROS Python Bindings #48
Conversation
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.
Looks good!
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.
- We could probably rename ComputeJointSpacePath as ComputeRetimedJointSpacePath? 2. We could change the compute_retime_path function to only accept aikido::trajectory::Interpolated typed trajectory?
I have tested this branch with another lab assignment code and it works great!
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 mostly have some quick high-level questions:
- Would it make sense to move
src/adapy
to a top-leveladapy
directory orpython/adapy
? Otherwise, the layout ofsrc
andinclude
no longer match our other repos. (python/adapy
would matchpython/aikidopy
; it might also then make sense to move the Python scripts into, say,python/tests
.) - Should we organize this PR into two? One with actual
libada
changes, one with bindings. - Do bindings need to be defined as C++ lambda expressions? I feel like this would be way more readable if, say, we explicitly named the
create_ik
function and then did all the modulem.def
stuff with those named functions.
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.
Do bindings need to be defined as C++ lambda expressions? I feel like this would be way more readable if, say, we explicitly named the
create_ik
function and then did all the modulem.def
stuff with those named functions.
I'm willing to accept the changes as is for now, but I still feel like this would be better.
An update: I've (finally) managed to get my dev box set up with 20.04 + Noetic. I can confirm that from a fresh, standard machine install everything works fine. The pybind11 version is more than sufficient and everything works great in sim :) I'm going to work on some more of this feedback from @brianhou now that I have the new env set up and working 😃 |
@brianhou and others, I've responded to the lambda feedback and cleaned up a few other things. I think we're ready for a final review? I wasn't sure whether to use camel case for the named methods since that seemed a little confusing, but happy to change it if we want :) |
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 looks good!
Everything still runs perfectly on the real bot. Merging as admin past the Travis checks. Good job all! |
This PR adds in the Python bindings from https://github.com/icaros-usc/libada. The ultimate goal is to replace their stack with ours, while still conforming to the same Python API. Since most of ICAROS's work goes through the Python bindings (as far as I know) it shouldn't matter that PRL's C++ guts are much more up-to-date.
This PR essentially 1) adds in the binding source files and then 2) fixes everything to build (switching over methods that we've deprecated in AIKIDO, finding pybind11 in a more-general way, adding methods to the
Ada.hpp
interface that ICAROS added, etc). I also think I've fixed a few bugs in the original bindings (or at least what I perceived as bugs 😅).There are also two large outstanding issues:
1. The version of pybind11 used in these bindings (and it looks like the version used in our
aikidopy
bindings as well) is 2.2.0. Most of PRL currently uses Ubuntu 18.04, which packages pybind11 2.0.1. Downgrading the pybind11 version is messy and doesn't seem to make sense: my gut is to 1) make building the bindings optional and 2) provide clear documentation on how to install a proper version of pybind11 from source (it's actually incredibly easy).2. More critical: right now it looks like ICAROS is using ROS1, whereas PRL one day wants to move to ROS2. Unfortunately, because ROS1 doesn't support Python 3 I've had to set the Python version at 2.7. There are other barriers to moving to Python 3: installing
python3-rospkg
seems to uninstall all of the ROS melodic packages, which is definitely a big deal. I know @egordon was really set on setting Python 3, so this is something we need to debate. It seems like 2.7 is ugly, while 3.6 is potentially a show-stopper for ICAROS.Testing Plan
I ran
simple_trajectories.py
, and it works great! :)Before creating a pull request
make format
Before merging a pull request