-
Notifications
You must be signed in to change notification settings - Fork 82
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
Python bidings for the measured force contact #251
base: devel
Are you sure you want to change the base?
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.
Thanks for this !
Could you add an entry in tests/python/CMakeLists.txt
for your test ?
bindings/python/CMakeLists.txt
Outdated
@@ -19,6 +19,7 @@ set(${PYWRAP}_SOURCES | |||
contacts/contact-6d.cpp | |||
contacts/contact-point.cpp | |||
contacts/contact-two-frame-positions.cpp | |||
contacts/measured-6Dwrench |
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.
missing file extension
I would rename the file following the naming convention of the project.
@@ -0,0 +1,114 @@ | |||
// | |||
// Copyright (c) 2022 CNRS INRIA LORIA |
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.
Sure about the year?
@@ -273,6 +276,10 @@ struct InvDynPythonVisitor | |||
const solvers::HQPOutput& sol) { | |||
return self.getContactForces(name, sol); | |||
} | |||
static bool addMeasuredForce(T& self, | |||
contacts::Measured6Dwrench measured_force) { |
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.
Missing reference.
|
||
inline void exposeContact() { | ||
exposeContact6d(); | ||
exposeContactPoint(); | ||
exposeContactTwoFramePositions(); | ||
exposeMeasured6Dwrench(); |
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.
For consistency with the already existing "Contact6d" I would prefer using "Measured6dWrench", without capitalizing the "d" after 6.
@@ -21,19 +21,22 @@ | |||
#include "tsid/bindings/python/contacts/contact-6d.hpp" | |||
#include "tsid/bindings/python/contacts/contact-point.hpp" | |||
#include "tsid/bindings/python/contacts/contact-two-frame-positions.hpp" | |||
#include "tsid/bindings/python/contacts/measured-6Dwrench.hpp" |
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.
Even here, for consistency, I would rename this file "measured-6d-wrench.hpp"
Hi, |
You are right that we already have inconsistencies. However, we should at least avoid adding more inconsistencies to the code. If you also wanna fix the naming inconsistencies of the 3d force that'd be an added value for this PR. |
For now I fixed the inconsistent naming only on the bindings side |
Hi,
I noticed there was no python bindings for the measured force contacts, so I implemented them following the recommendation made for a similar issue.
I added the measure6Dwrench contact type to the bindings, the addMeasuredForce binding in the formulation and a test script that checks the creation of this contact, the setting of its value and its addition to the inverse dynamics formulation.
Let me know if it is ok or if you have any suggestions,
Have a nice day