University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Bug in SBJointMap.cpp | General SmartBody Discussion | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Bug in SBJointMap.cpp
September 26, 2014
10:47 am
Avatar
Member
Members
Forum Posts: 8
Member Since:
September 26, 2014
sp_UserOfflineSmall Offline

Hi

There is a nasty bug in SBJointMap::getSource(int) & SBJointMap::getTarget(int). It was created by the following commit; 

http://sourceforge.net/p/smart.....4/#diff-11

In short the 2 functions assume that the order of a map iterator is the order in which the elements were inserted into the map. This caused an issue for me when save/exporting an asset from sbgui, as the joint maps ended up being all wrong. 

I was going to fix myself, but after looking at it I was not sure what else it might affect. On that note, is there any chance you might move your repository to Mecurial or Git on BitBucket or GitHub. It makes it a million times easier for people to contribute and help fix bugs for you :)

October 3, 2014
9:22 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

You can send me your changes, and I'll incorporate them.

I haven't looked into changing from SVN (on SourceForge) to another host. We are considering changing the SmartBody license to something more permissive. If we do that, we might also move the repository.

 

Ari

October 6, 2014
4:32 pm
Avatar
Member
Members
Forum Posts: 8
Member Since:
September 26, 2014
sp_UserOfflineSmall Offline

I am having real issues with the SVN repo (it just timesout :( ), so currently using the SDK download. As a result I am un-able to create a patch for you. However the fix is relatively straightforward. Just change SBJointMap::getTarget(int num) to this; NB we use _sourceMap, the same as getSource. 

const std::string& SBJointMap::getTarget(int num)
{
  #ifdef USE_TWO_MAPS
  int count = 0;
  for (std::map<std::string, std::string>::iterator iter = _sourceMap.begin();
        iter != _sourceMap.end();
        iter++)
  {
    if (count == num)
    return (*iter).second;
    count++;
  }
#else

This bug crept in due to a performance tweak, however I think a sorted vector pattern might be better here, depending on how the joint map is used. Ill do some performance evaluation when I have a working system and send some patches your way if I find anything notable.

October 6, 2014
11:36 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Thanks, I'll test it out.

Forum Timezone: America/Los_Angeles

Most Users Ever Online: 733

Currently Online: mcclurelloyd91, Andreytielo, kvistaagesen6, shorebagger6, rubingriffith1, campbennedsen38, carrollpratt5, fosskrog0, magnussonmagnusson3, zhuwarner26, dreyer26guerrero, miscreantunderc69, BernardFaulkner25
70 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

jwwalker: 80

jyambao: 52

rbaral: 47

adiaz: 30

WargnierP: 29

lucky7456969: 28

mbarros: 28

avida.matt: 26

JonathanW: 24

laguerre: 23

Member Stats:

Guest Posters: 69

Members: 122101

Moderators: 3

Admins: 4

Forum Stats:

Groups: 1

Forums: 5

Topics: 531

Posts: 2495