rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
709 stars 343 forks source link

shoulder-elbow-wrist configurations #1043

Open frankymacster opened 2 years ago

frankymacster commented 2 years ago

Hi, I'm wondering if it's possible from the set of solutions of an IKFast generated IK solver to extract a specific solution with a given shoulder-elbow-wrist configuration.

For example, some robot simulation applications allow to choose a specific shoulder-elbow-wrist configuration:

corresponding to one of the joint configurations here

Screen Shot 2022-01-25 at 10 00 47

Thanks!

cielavenir commented 2 years ago

@frankymacster If you specify ikreturn=True to FindIKSolutions(), special class instance is returned and extra info can be accessed via GetMapDataDict(). Please see solutionindices field.

frankymacster commented 2 years ago

Thanks @cielavenir!

Will I be able to select a specific configuration from the IK solutions list? For example if I only want the IK solution with the following configuration:

can I access the value returned by GetMapDataDict() some way like mapDataDict["FUN"]?

(I'm asking because I don't see any mention of should-elbow-wrist configurations in the code in plugins/ikfastsolvers/ikfastsolver.cpp)

cielavenir commented 2 years ago

GetMapDataDict()['solutionindices'], mentioned as _mapdata["solutionindices"] in plugins/ikfastsolvers/ikfastsolver.cpp

frankymacster commented 2 years ago

ok yes I see it here

but what do the solutionindices consist of? from that code it seems to be a std::vector of dReal (double).

How can I know which index corresponds to the following configuration?

cielavenir commented 2 years ago

the type is double but it actually represents 0-7 integers (for 6dof robots). that is the index for each solution. you have to figure out which one corresponds to shoulder-front_elbow-up_wrist-non-flip on your own.

frankymacster commented 2 years ago

Ok I see, so solutionindices holds a list of 8 integers (for 6dof robots), one for each solution. Will the order of the solutions always be the same every time the IK solver is run on a different input?

For example, will the index corresponding to "shoulder-front_elbow-up_wrist-non-flip" always be the same in the solutionindices for a given robot on any rotation, position input?

cielavenir commented 2 years ago

Sorry I'm not sure for this matter, https://github.com/rdiankov/openrave/pull/809 might be helpful...

frankymacster commented 2 years ago

Thanks a lot @cielavenir! I will verify if the index corresponding to "shoulder-front_elbow-up_wrist-non-flip" always be the same in the solutionindices for a given robot on any rotation, position input and take a look #809.