Skip to content
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

[WIP] Fix Real Time IK #3705

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

[WIP] Fix Real Time IK #3705

wants to merge 10 commits into from

Conversation

RTnhN
Copy link
Contributor

@RTnhN RTnhN commented Feb 13, 2024

Fixes issue #3415

Brief summary of changes

The inverseKinematicsSolver for real time applications was not working. This is a work in progress to try to get it working again. This branch currently has debug code that I will remove in the final version.

Testing I've completed

Right now, I am just using the RealTimeKin repo to test to see if it works. Once I get that to work, I will run through the other tests to make sure that I did not break anything else.

Looking for feedback on...

See the linked issue for most of the conversation. I recently fixed the binding interface by including the namespace, so it compiles and has the BufferedOrientationsReference as a smart pointer. It still seems to have a different instance for the object when the PutValues method is called and when the GetValueAtTime method is called in the InverseKinematicsSolver. The data queue has data after I put the data and is empty when I go to get a value.

The really hacky way that I have been able to get the real time ik working is with just moving the method that adds data to the queue up to the IKSolver class, but this is not ideal.

CHANGELOG.md (choose one)

  • will update.

This change is Reviewable

CMakeLists.txt Outdated
@@ -438,6 +438,9 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" OR
NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "5.0.0"))
add_compile_options(-Wno-unused-local-typedefs)
endif()
# There are so many warnings about using GCC > 7.1. It should be mostly
# harmless, so we can disable it.
add_compile_options(-Wno-psabi)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Driveby comment while you develop, but isn't this quite hamful? Disabling ABI checks on a binary-distributed library codebase like OpenSim for all builders is a no no.

If you're doing something like cross-compiling with a weird compiler etc. etc. and you want this flag for your build specifically then you can specialize in your buildscript by setting the CXXFLAGS environment variable:

https://www.google.com/search?client=firefox-b-d&q=CXXFLAGS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that is a much better option. I'll revert that commit.

@@ -116,14 +116,14 @@ class OSIMSIMULATION_API OrientationsReference
int getNumRefs() const override;
/** get the time range for which the OrientationsReference values are valid,
based on the loaded orientation data.*/
SimTK::Vec2 getValidTimeRange() const override;
virtual SimTK::Vec2 getValidTimeRange() const override;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DBC#2: override implies virtual - typical practice is to virtual the base class's method (it has nothing to override) and then override in all deriving classes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. There were a few methods in this class that did not follow this pattern like the hasNext() method that has the virtual keyword in the Reference class, the OrientationsReference class, and the BufferedOrientationsReference class. I can revert these changes though.

virtual bool hasNext() const override = 0;

virtual bool hasNext() const override { return false; };

virtual bool hasNext() const override { return !_finished; };

@RTnhN
Copy link
Contributor Author

RTnhN commented Feb 14, 2024

Note to self: I think the reason why the build is failing is due to shared pointers of base and derived classes. I discuss it here: #3415 (comment). I thought that using the namespace would fix it, but I think it needs the full inheritance chain (both all derived and all base) to be defined as shared pointers using the macro as discussed in the docs for SWIG. This is not workable since the most base class is the Object class that is the base of so many classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants