University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Locomotion not stopping | 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
Locomotion not stopping
September 18, 2015
1:58 pm
Avatar
Germany
Member
Members
Forum Posts: 24
Member Since:
June 22, 2015
sp_UserOfflineSmall Offline

Hello,

If I send a locomotion command to my avatar, the locomotion is started correctly and and the avatar moves towars the target position. However, when it approaches the location it slows down but then at some point seems to make up its mind and accelerates again and walks on in that direction off to infinity.

Then sending command I use in C++ is:

m_pVSBCore->getSBBmlProcessor()->execBML("Rachel_0","<locomotion type=\"basic\" target=\" -1 0\"/>");

Then at some point I get the error message:

Character Rachel_0 is out of range of grid (-500.000366, -230.772552). All goals will be cancelled.

Any ideas why this might happen, an idea that crossed my mind was that this might happen, because I moved the character to a non-integer position in the beginning, using:

SBCharacter pC = scene->getCharacter(name);
pC->setPosition(SrVec(1.48f, 0.0f, 1.09f));

And therefore it might not be on the grid and not exactly reach the desired position. Put in general it is possible to use float values, also for locomotion targets, right?

September 18, 2015
6:22 pm
Avatar
Admin
Forum Posts: 980
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Yes, you can use float values for target positions.

There is a steering grid that represents the area that the character is allows to steer within (the next version of the steering algorithm will eliminate this requirement). There are a few attributes that can be set:

 

scene.getSteerManager.setDoubleAttribute("gridDatabaseOptions.gridSizeX", 35)

scene.getSteerManager.setDoubleAttribute("gridDatabaseOptions.gridSizeZ", 35)

scene.getSteerManager.setIntAttribute("gridDatabaseOptions.numGridCellsX", 70)

scene.getSteerManager.setIntAttribute("gridDatabaseOptions.numGridCellsZ", 70)

There is some documentation on page 117 of the SmartBody manual about steering settings.

If the character goes outside of the grid, you'll get that message.

Not sure why the speedup happens. Does this also happen when you use the example locomotion, not the basic one?

Ari

September 25, 2015
10:50 am
Avatar
Germany
Member
Members
Forum Posts: 24
Member Since:
June 22, 2015
sp_UserOfflineSmall Offline

Hello,

thank you for your response. I now adapted the above metioned values, to better fit the small indoor scene I am working with to gridSize(both directions) 10.0 and numGridCells (both direction) 500.

Howver, the Problem remains the same (only that Rachel now stops earlier, because she left the grid). I am not sure whether the problem could be that I use a scene scale of 1.0 and not 0.01 (but setting it to 0.01 did not help solving the problem either)

I do not really understand what you mean with using the example locomotion. If I try using type=example instead of type=basic nothing happens.

I also tried to get some ideas from the manual, but I had actually already read that part. The only thing that was new to me was using the single-cycle locomotion but I think these are just for introducing new motions into the system, right?

After testing a bit more I get the feeling that repositioning the character in the way I described above might be the problem. Sending Rachel from 0.0, 0.0 to -2.0, -2.0 works perfectely but sending her from 1.0, 1.0 to -1.0, -1.0 gives the above described error. However, this should simply be the same movement. So is there another method I have to use then SBCharacter::setPosition such that the steering agent is reset correctly as well?

September 25, 2015
5:58 pm
Avatar
Admin
Forum Posts: 980
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

If you are using Rachel, put a scene scale of 1.0 (which is meters, which is what the Rachel character model is proportioned to).

There are a few different types of locomotion; the example-based locomotion uses a set of nearly 40 motions as 'examples' for how to move, that are then blended together according to direction and speed. That is the type of locomotion that is animated in the way that people normally move.

 

Can you  post a video of the problems you are having? Also, can you post the log of output  that is produced (you can write to a file using:

 

scene->startFileLogging("smartbody.log")

 

Ari

September 28, 2015
1:51 pm
Avatar
Germany
Member
Members
Forum Posts: 24
Member Since:
June 22, 2015
sp_UserOfflineSmall Offline

Ok, here is a video of Rachel walking from (1.0, 0.0, -1.5) towards (-1.56, 0.0, 1.9) (where the red circle is). However, it seems as if she misses it a bit and the just run out of the grid:

 

https://vid.me/yuNP

The output of the log is:

Face neutral motion is now 'ChrRachel@face_neutral'.
Setting up behavior set for MaleMocapLocomotion...
Loading [behaviorsets/MaleMocapLocomotion/skeletons]
locomotion smooth cycle
Character Rachel_0 will use FAC 45 left and right to control blinking.
max Items per grid cell = 7
INIT STEERSIM
LOADING STEERSIM
No steering agent for character Rachel_0
No characters set up with steering. Steering will need to be restarted when new characters are available.
STARTING STEERSIM
Setting up behavior set for MaleMocapLocomotion...
Steer agent with name Rachel_0 already exists.
Motion named ChrMarine@Turn90Lf01 already exists, new motion will not be added.
Init Steer Agent
Rachel_0: Steering works under standard config.
max Items per grid cell = 7
INIT STEERSIM
LOADING STEERSIM
Setting up steering agent for character Rachel_0
STARTING STEERSIM
Character Rachel_0 is out of range of grid (-5.008096, 4.281365). All goals will be cancelled.

Any ideas where this might be coming from, I don't get this problem when I do not move her away, than she perfectly reaches that spot.

Also how can I get the example locomotion, type=example does not appear tio change anything

October 1, 2015
9:21 am
Avatar
Germany
Member
Members
Forum Posts: 24
Member Since:
June 22, 2015
sp_UserOfflineSmall Offline

Hello,

I did some more testing and found out that the problem comes directly from the steering, the direction towards the target seems to be pretty unprecise and therefore the agent misses the target by more than 20cm (which is the hardcoded define PED_REACHED_TARGET_DISTANCE_THRESHOLD to detect a reaching of the target), so that no reaching is detected.

Here is for example the position output:

sending locomotion Rachel_0
( +0.000, +0.000, +0.000 | 1 )
( -0.103, +0.000, -0.011 | 1 )
( -0.122, +0.000, -0.043 | 1 )
( -0.143, +0.000, -0.070 | 1 )
( -0.167, +0.000, -0.097 | 1 )
( -0.188, +0.000, -0.123 | 1 )
( -0.208, +0.000, -0.148 | 1 )
( -0.231, +0.000, -0.174 | 1 )
( -0.257, +0.000, -0.206 | 1 )
( -0.276, +0.000, -0.236 | 1 )
( -0.300, +0.000, -0.273 | 1 )
( -0.331, +0.000, -0.319 | 1 )
( -0.367, +0.000, -0.368 | 1 )
( -0.405, +0.000, -0.413 | 1 )
( -0.444, +0.000, -0.452 | 1 )
( -0.482, +0.000, -0.482 | 1 )
( -0.520, +0.000, -0.503 | 1 )
( -0.558, +0.000, -0.519 | 1 )
( -0.596, +0.000, -0.532 | 1 )
( -0.638, +0.000, -0.541 | 1 )
( -0.689, +0.000, -0.545 | 1 )
( -0.751, +0.000, -0.546 | 1 )
( -0.785, +0.000, -0.545 | 1 )
( -0.821, +0.000, -0.543 | 1 )
( -0.858, +0.000, -0.539 | 1 )
( -0.893, +0.000, -0.535 | 1 )
( -0.927, +0.000, -0.532 | 1 )
( -0.959, +0.000, -0.530 | 1 )
( -1.018, +0.000, -0.527 | 1 )
( -1.077, +0.000, -0.527 | 1 )
( -1.114, +0.000, -0.530 | 1 )
( -1.146, +0.000, -0.534 | 1 )
( -1.182, +0.000, -0.539 | 1 )
( -1.217, +0.000, -0.546 | 1 )
( -1.254, +0.000, -0.553 | 1 )
( -1.298, +0.000, -0.562 | 1 )
( -1.344, +0.000, -0.573 | 1 )
( -1.392, +0.000, -0.588 | 1 )
( -1.436, +0.000, -0.601 | 1 )
( -1.485, +0.000, -0.616 | 1 )
( -1.526, +0.000, -0.627 | 1 )
( -1.566, +0.000, -0.638 | 1 )
( -1.608, +0.000, -0.647 | 1 )
( -1.648, +0.000, -0.653 | 1 )
( -1.690, +0.000, -0.658 | 1 )
( -1.732, +0.000, -0.662 | 1 )
( -1.773, +0.000, -0.666 | 1 )
( -1.814, +0.000, -0.668 | 1 )
( -1.852, +0.000, -0.671 | 1 )
( -1.893, +0.000, -0.674 | 1 )
( -1.934, +0.000, -0.676 | 1 )
( -1.978, +0.000, -0.677 | 1 )
( -2.025, +0.000, -0.676 | 1 )
( -2.073, +0.000, -0.673 | 1 )
( -2.120, +0.000, -0.669 | 1 )
( -2.164, +0.000, -0.665 | 1 )
( -2.208, +0.000, -0.661 | 1 )
( -2.248, +0.000, -0.658 | 1 )
( -2.289, +0.000, -0.656 | 1 )
( -2.331, +0.000, -0.655 | 1 )
( -2.377, +0.000, -0.655 | 1 )
( -2.423, +0.000, -0.656 | 1 )
( -2.470, +0.000, -0.658 | 1 )
( -2.516, +0.000, -0.660 | 1 )
( -2.565, +0.000, -0.661 | 1 )
( -2.615, +0.000, -0.660 | 1 )
( -2.684, +0.000, -0.663 | 1 )
( -2.720, +0.000, -0.667 | 1 )
( -2.763, +0.000, -0.671 | 1 )
( -2.806, +0.000, -0.673 | 1 )
( -2.849, +0.000, -0.676 | 1 )
( -2.893, +0.000, -0.677 | 1 )
( -2.933, +0.000, -0.678 | 1 )
( -2.976, +0.000, -0.677 | 1 )
( -3.020, +0.000, -0.676 | 1 )
( -3.060, +0.000, -0.675 | 1 )
( -3.102, +0.000, -0.676 | 1 )
( -3.143, +0.000, -0.677 | 1 )
( -3.186, +0.000, -0.681 | 1 )
( -3.230, +0.000, -0.683 | 1 )
( -3.275, +0.000, -0.684 | 1 )
( -3.326, +0.000, -0.683 | 1 )
( -3.374, +0.000, -0.681 | 1 )
( -3.421, +0.000, -0.677 | 1 )
( -3.467, +0.000, -0.673 | 1 )
( -3.511, +0.000, -0.672 | 1 )
( -3.555, +0.000, -0.673 | 1 )
( -3.598, +0.000, -0.675 | 1 )
( -3.643, +0.000, -0.678 | 1 )
( -3.687, +0.000, -0.682 | 1 )
( -3.729, +0.000, -0.685 | 1 )
( -3.773, +0.000, -0.689 | 1 )
( -3.818, +0.000, -0.690 | 1 )
( -3.863, +0.000, -0.692 | 1 )
( -3.910, +0.000, -0.695 | 1 )
( -3.958, +0.000, -0.700 | 1 )
( -4.010, +0.000, -0.705 | 1 )
( -4.059, +0.000, -0.711 | 1 )
( -4.102, +0.000, -0.716 | 1 )
( -4.144, +0.000, -0.719 | 1 )
( -4.185, +0.000, -0.722 | 1 )
( -4.228, +0.000, -0.722 | 1 )
( -4.271, +0.000, -0.723 | 1 )
( -4.313, +0.000, -0.723 | 1 )
( -4.356, +0.000, -0.723 | 1 )
( -4.398, +0.000, -0.724 | 1 )
( -4.440, +0.000, -0.726 | 1 )
( -4.484, +0.000, -0.728 | 1 )
( -4.528, +0.000, -0.728 | 1 )
( -4.576, +0.000, -0.727 | 1 )
( -4.625, +0.000, -0.725 | 1 )
( -4.675, +0.000, -0.721 | 1 )
( -4.721, +0.000, -0.717 | 1 )
( -4.767, +0.000, -0.714 | 1 )
( -4.811, +0.000, -0.712 | 1 )
( -4.851, +0.000, -0.712 | 1 )
( -4.893, +0.000, -0.712 | 1 )
( -4.939, +0.000, -0.713 | 1 )
( -4.984, +0.000, -0.715 | 1 )
Character Rachel_0 is out of range of grid (-5.029719, -0.717372). All goals will be cancelled.

Is there any parameter that I can tune to make this initial pointing towards the target more precise? Or any other ideas what might be the problem here?

 

While stepping through your code I also found another bug in SBSteerManager::getSteerAgent(), I think using [] there is a bad choice because it creates an entry in the map if the key is not present, so that the map gets a bit messy with NULL-pointer entries and getNumSteerAgents() returns wrong numbers, therefore better find() should be used, e.g., like this:

SBSteerAgent* SBSteerManager::getSteerAgent(std::string name)
{
    std::map<std::string, SBSteerAgent*>::iterator iter = _steerAgents.find(name);
    if (iter != _steerAgents.end())
    {
        return iter->second;
    }
    return NULL;
}

October 1, 2015
7:56 pm
Avatar
Admin
Forum Posts: 980
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

but your scene scale is set to meters (1.0)?

scene.setScale(1.0)

 

A value of .2 should be small enough...? Have you tried changing that value to see if setting a smaller value works?

 

Thanks for the code improvements, will incorporate them.

 

Ari

October 1, 2015
8:00 pm
Avatar
Admin
Forum Posts: 980
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Looks like I've already made that change in revision 5968. Can you try updating to a newer version of SmartBody, which might in turn fix your locomotion problem?

Ari

October 6, 2015
12:35 pm
Avatar
Germany
Member
Members
Forum Posts: 24
Member Since:
June 22, 2015
sp_UserOfflineSmall Offline

Yes, that acutally solved the problem. No idea why I was working on such an old version. Sorry

Thank you very much

Forum Timezone: America/Los_Angeles

Most Users Ever Online: 733

Currently Online: mondayneedle1, kristensen00leblanc, worriedutopia9579, DixieDelgado, lyinglegacy8966, eric506784, t9rrzpi307
95 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

jwwalker: 80

jyambao: 51

rbaral: 47

adiaz: 30

WargnierP: 29

lucky7456969: 28

mbarros: 28

avida.matt: 26

JonathanW: 24

laguerre: 23

Member Stats:

Guest Posters: 65

Members: 52460

Moderators: 3

Admins: 4

Forum Stats:

Groups: 1

Forums: 5

Topics: 427

Posts: 2343