|
From: Bener S. <ben...@gm...> - 2014-07-09 17:55:42
|
OK, so then I'll just keep my code as it is (the way I sort and erase
duplicates).
I would think that SetActiveDOFs would do that for me internally for its
own error handling but apparently it doesn't, which is fine.
Thanks for the advice!
Ben
2014-07-09 10:51 GMT-07:00 Dmitry Berenson <dbe...@cs...>:
> Hi Ben,
>
> This is interesting, I've never tried putting in duplicate DOF indices. I
> think in general you may not want to temp fate by duplicating indices in
> openrave's activedofs. For instance, if you have a vector of joint values
> and you put different joint values for the same DOF, I'm not sure what
> openrave would do. If GeneralIK is doing that the results could be pretty
> ugly. I would suggest that you filter out the duplicate active DOF before
> calling SetActiveDOFs anywhere in openrave (i.e. right after you get the
> indices from the manipulators).
>
> Dmitry
>
>
>
> On Wed, Jul 9, 2014 at 1:40 PM, Bener Suay <ben...@gm...> wrote:
>
>> Hi,
>>
>> my robot model has two 10 DOF manipulators and the first three joints of
>> these manipulators are the same. To be more specific:
>>
>> leftArm indices: 0,1,2,3,4,5,6,7,8,9
>> rightArm indices: 0,1,2,10,11,12,13,14,15,16
>>
>> In OpenRAVE (0.8.2 Stable Release), I do the following to activate my two
>> manipulators so I can run DoGeneralIK for the end effectors:
>>
>> for( size_t m=0; m < manipIdx.size(); m++)
>> {
>> activedofs.insert( activedofs.end(),
>>
>> probot->GetManipulators()[manipIdx[m]]->GetArmIndices().begin(),
>>
>> probot->GetManipulators()[manipIdx[m]]->GetArmIndices().end()
>> );
>> }
>>
>> The block above gives me the vector<int> activedofs as
>>
>> {0,1,2,3,4,5,6,7,8,9,0,1,2,10,11,12,13,14,15,16}
>>
>> And then I do
>>
>> probot->SetActiveDOFs(activedofs);
>>
>> as usual.
>>
>> To confirm that the indices are actually active I do:
>>
>> vector<int> dbug = probot->GetActiveDOFIndices();
>> cout << "checking which indices are active: " << endl;
>> // debug
>> for( size_t i=0; i < dbug.size(); i++)
>> {
>> cout << dbug[i] << endl;
>> }
>>
>> And this prints out the same indices.
>>
>> So far so good...
>>
>> Now when I make a call to DoGeneralIK with this set of active indices,
>> the joints that overlap between manipulators (namely 0, 1 and 2) behave as
>> if they are not active (that is, they don't move).
>>
>> *However*, if I eliminate the repeating indices with the following two
>> lines
>>
>> sort(activedofs.begin(), activedofs.end());
>> activedofs.erase(unique(activedofs.begin(), activedofs.end()),
>> activedofs.end());
>>
>> so that, my vector of activedofs is
>>
>> {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
>>
>> In this case DoGeneralIK behaves as expected.
>>
>> I'm wondering if this is a SetActiveDOFs issue, or if this is related to
>> the way DoGeneralIK method handles GetActiveDOFIndices()... Curious.
>>
>> I'd be happy to contribute with the two-liner "remove repeating indices"
>> block if that really is the appropriate / elegant solution for the issue.
>>
>> Thanks for your attention,
>> Ben Suay
>> wpi.edu/~benersuay
>>
>>
>> ------------------------------------------------------------------------------
>> Open source business process management suite built on Java and Eclipse
>> Turn processes into business applications with Bonita BPM Community
>> Edition
>> Quickly connect people, data, and systems into organized workflows
>> Winner of BOSSIE, CODIE, OW2 and Gartner awards
>> http://p.sf.net/sfu/Bonitasoft
>> _______________________________________________
>> comps-users mailing list
>> com...@li...
>> https://lists.sourceforge.net/lists/listinfo/comps-users
>>
>>
>
|