University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Assistance with a crashing example | 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
Assistance with a crashing example
April 27, 2016
12:03 pm
Avatar
Member
Members
Forum Posts: 26
Member Since:
September 16, 2015
sp_UserOfflineSmall Offline

The following example crashes at setting the "createPhysics" attribute. This occurs with both the latest Linux SDK and the previous version of the Linux SDK. Assistance determining what is done incorrectly with the example is appreciated.

The goal is to be able to eventually add an observer to the collision service (SBCollisionManager) and customize collision resolution.

Submitting the post with code is continually denied in various formats.

Here is a link to the pasted code: http://codepad.org/JjU3ByAM

Thank you.

May 2, 2016
8:49 am
Avatar
Member
Members
Forum Posts: 26
Member Since:
September 16, 2015
sp_UserOfflineSmall Offline

The link above is updated and should not expire.

May 2, 2016
10:37 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

The code seems to work for me, but I had to make sure that the media path was set correctly, and I'm running on Windows (not linux) so there might be an issue with the linux version.

 

Ari

May 10, 2016
8:02 am
Avatar
Member
Members
Forum Posts: 26
Member Since:
September 16, 2015
sp_UserOfflineSmall Offline

Thank you for testing. As you said, it must be an error in the Linux SDK. The latest version (r6296) is being used.

Is there a bug tracker to file a report?

Would it be worth compiling and testing the SVN version or is the issue likely to still persist?

May 16, 2016
11:45 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

I haven't looked at the linux version for a number of months, but you could try it out. When I have some time I'll look at this, but it may be awhile...

A bug tracker is a good idea, I don't have one yet.

 

Ari

May 18, 2016
9:34 am
Avatar
Member
Members
Forum Posts: 26
Member Since:
September 16, 2015
sp_UserOfflineSmall Offline

Understood. Thank you for being clear with that.

An older SDK version still contains the issue.

Do you accept patches? If so, where/how?

Bug trackers definitely can help. There's quite a few self-hosted ones. GitHub and Bitbucket each have an integrated tracker, if the rest of the system suits your needs.

May 19, 2016
9:33 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

If you have a patch, please email it to me at shapiro@ict.usc.edu.

 

Yes, I need to get a bug tracker to help with this. I've been holding off since I am thinking about switching from sourceforge to github, but haven't found the time to do that yet.

 

Ari

May 19, 2016
10:14 am
Avatar
Member
Members
Forum Posts: 26
Member Since:
September 16, 2015
sp_UserOfflineSmall Offline

Will do. It'll be a little while before the patch is sent.

May 23, 2016
10:42 am
Avatar
Member
Members
Forum Posts: 26
Member Since:
September 16, 2015
sp_UserOfflineSmall Offline

I have sent two patches addressing the issue. Each one solves the issue in a different way.

Summary of issue and solution for those viewing this thread:

In the Linux SDK r6296, a problem manifests itself as a crash when enabling collision or physics, or when using box collision shapes upon using the "createPhysics" action attribute. Upon debugging it is visible that the data being passed to an ODE function is valid but upon entering the ODE function, before executing any further source code instructions, the data has changed to invalid values. This happens because the type definition of "dReal" is different in SmartBody than in ODE.

 
The SmartBody SDK build file defines double precision usage for the included ODE headers with the flag "-DdDOUBLE" in "src/SmartBody/CMakeLists.txt". The ODE library downloaded and built using "linuxlibsdownload.sh" and "linuxlibsbuild.sh", is built with default flags where "-DdSINGLE" is defined. The type definition for "dReal" is based upon this define and thus the error takes place. The solution, when SINGLE precision is wanted, is to replace the SmartBody SDK CMake compilation definition with the SINGLE precision definition (replace -DdDOUBLE with -DdSINGLE).
 
It may not be desirable to use single (float) precision. Double (double) precision may be desired. The solution in this case is to modify the dependency build script ("linuxlibsdownload.sh") to build ODE with DOUBLE precision support (done via adding --enable-double-precision to the configure line for ODE).
May 25, 2016
6:19 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Thanks for that, I've made the change in linuxlibsbuild.sh.

 

Ari

Forum Timezone: America/Los_Angeles

Most Users Ever Online: 733

Currently Online: Jamesnuh, gotselyuk1987mon, levinebarron45, koenig62ramos, krygerhagen69, coxgeorge3, doyle68bekker, ludvigsen62abbott, shortstext78, cormierhopper5
71 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: 67

Members: 100502

Moderators: 3

Admins: 4

Forum Stats:

Groups: 1

Forums: 5

Topics: 460

Posts: 2403