Added MecanumDriveOdometry Python wrapper#549
Conversation
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## ign-math6 #549 +/- ##
==========================================
Coverage 99.38% 99.38%
==========================================
Files 75 75
Lines 7029 7029
==========================================
Hits 6986 6986
Misses 43 43 ☔ View full report in Codecov by Sentry. |
|
Is it okay if we wait till after Harmonic for this? |
|
this is targeting Fortress, but we can wait no problem |
I understand, but I think we should focus our review efforts on |
|
friendly ping @azeey @scpeters or @adityapande-1995 |
| std::string pyclass_name = typestr; | ||
| py::class_<Class>(m, | ||
| pyclass_name.c_str(), | ||
| py::buffer_protocol(), |
There was a problem hiding this comment.
Do we need py::buffer_protocol here? If so, doesn't it require implementing def_buffer (https://pybind11.readthedocs.io/en/stable/advanced/pycpp/numpy.html)
There was a problem hiding this comment.
I don't think this has been addressed
| # Setup the wheel parameters, and initialize | ||
| odom.set_wheel_params(wheelSeparation, wheelRadius, wheelRadius,wheelRadius) | ||
| startTime = datetime.datetime.now() | ||
| odom.init(datetime.timedelta()) |
| Angle(1.0 * math.pi / 180), | ||
| Angle(1.0 * math.pi / 180), | ||
| Angle(1.0 * math.pi / 180), | ||
| time1 - startTime) |
There was a problem hiding this comment.
The C++ version uses just time1 here.
| Angle(2.0 * math.pi / 180), | ||
| Angle(2.0 * math.pi / 180), | ||
| Angle(2.0 * math.pi / 180), | ||
| time2 - startTime) |
There was a problem hiding this comment.
This is also different from the C++ test
azeey
left a comment
There was a problem hiding this comment.
Looks good overall. Just a few issues with pybind11 options and differences with the C++ test
azeey
left a comment
There was a problem hiding this comment.
Looks good overall. Just a few issues with pybind11 options and differences with the C++ test
…mDriveOdometry_pytohn
|
@azeey Time is a little bit different in Python, you can take a look the |
|
friendly ping @azeey |
1 similar comment
|
friendly ping @azeey |
So from the pybind11 docs, it looks like |
|
@osrf-jenkins run tests |
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
|
@azeey I added your feedback |
Thanks. I think now the test can be updated to match the C++ version. Specifically, |
…mDriveOdometry_pytohn
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@azeey Included feedback |
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
🎉 New feature
Closes #548
Summary
Added MecanumDriveOdometry
Checklist
codecheckpassed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-bymessages.