"Working Bill" and IK

Typically: "How do I... ", "How can I... " questions
Post Reply
pearcema
Posts: 3
Joined: 12 Mar 2015, 22:20

"Working Bill" and IK

Post by pearcema »

Hello,

I'm new to V-REP. I am trying to simulate a human picking up an object, then walking across the room and placing it in a different location. Basically, I would like to implement the "reflexxesMotionLibraryType4Demo" scene but using a human instead of the robot. So far what I've done is created a new scene with one of the containers and cuboids, added "Working Bill", commented out the child script on "Working Bill", and created a dummy-dummy linking between "Bill_leftHand_tip" and one of the cuboid dummies.

I've noticed that the human model is very unstable. For example, in the IK tutorial, one of the steps was to try moving the target dummy around during simulation to see the robot following it. I tried this with my model, and even if I move the target point up a tiny bit (so within Bill's reach), he falls forward onto the container, actually going through the container. Eventually he falls backwards onto the floor.

Do I have something set up incorrectly? I would upload my scene but I don't see a way to attach a file.

Thanks!

coppelia
Site Admin
Posts: 10381
Joined: 14 Dec 2012, 00:25

Re: "Working Bill" and IK

Post by coppelia »

Hello,

the model Working Bill is a very simplified model of a human. If you look closely, it has only a spherical joint for the shoulder, and a revolute joint for the elbow. This means that you won't be able to orient its hands (i.e. do only set the X/Y/Z constraints for the corresponding IK element). If you move outside of the reachable area, it will become instable. Also, the elbow joints are not cyclic, they are limited. This might also lead to instabilities.

When working with IK it is important to understand that the number of degrees of freedom of the mechanism should not be lower than the number of degrees of freedom in the cartesian space of the target position/orientation (well, this is a simplified way of explaining it).

Also: when you look at the IK group that handles that model, it contains 8 different IK elements: many IK elements will try to be resolved at the same time (e.g. the left hand, the right hand, the posture, the knee bending, etc.). So in the end: there are many constrained degrees of freedom and the task is quite complex. So you need to very carefully design the kinematics of the human, and also the IK group content and its constraints.

Cheers

pearcema
Posts: 3
Joined: 12 Mar 2015, 22:20

Re: "Working Bill" and IK

Post by pearcema »

Thanks for the fast reply!

It sounds like I'll need to customize one of the "Bill" models to make it more flexible. I have a few follow up questions if you don't mind:
1. As a complete V-REP novice, which human model would you suggest I start with? Which is the most "human like"?
2. Are there any best practices when it comes to creating IK groups so that the task does not become overly complex?
3. Is there a way for me to do error detection and prevent Bill from becoming unstable before it's too late?
4. Can you refer me to any documentation that might help me customize "Bill" to complete the task I described in my original post?

I'd appreciate any other advice you might have. Thanks so much!


EDIT:
I removed the right hand elements from the IK group and it does appear much more stable now. I am able to make reasonable movements of the target and I can see Bill's arm following. Very cool!

This is great for my simple testing purposes, but in reality I'll need to use both arms with IK. Would you recommend creating several IK groups with a smaller # of elements versus one IK group with a larger # of elements? E.g. one IK group for the left arm (base:torso), one IK group for the right arm (base: torso), one for the head, one for the left leg, one for the right leg...?

coppelia
Site Admin
Posts: 10381
Joined: 14 Dec 2012, 00:25

Re: "Working Bill" and IK

Post by coppelia »

It depends what the human model has to do. For simple movements of the arm, a spherical joint for the shoulder and a revolute joint for the elbow should be enough. For the legs... if simple walking is enough, I would keep the 3 revolute joints per leg. But for walking I wouldn't use the IK functionality: it will not look good and be difficult to do it. For the walking I would use the keyframe interpolation.

If you handle the various IK tasks individually (e.g. right arm, left arm), this means, if each of those IK tasks is solved individually (i.e. each in a dedicated IK group), then things will become much easier and stable. You then however lose the connectivity between all elements: ideally, you want the waist/back to bend too if one of the hands is moving forward. Same if the two ands are lowered, ideally, you want the knees to bend and the whole uppe body to be lowered. But this is very complex to do it automatically with IK, since IK doesn't know how a real human behaves.

I would go with following simplified set-up:
  • each arm: a spherical joint for the shoulder, and a revolute joint for the elbow.
  • the waist/back: two joints for bending and rotation left/right
  • each leg: 3 revolute joints, as for the walking Bill model
  • you would have 2 IK elements in total: one for each arm
  • each arm's IK would be X/Y/Z constrained, and the base of the IK chain would be the upper body
  • bending/rotation of the back would be handled manually, by adjusting the position of the two revolute joints
Cheers

pearcema
Posts: 3
Joined: 12 Mar 2015, 22:20

Re: "Working Bill" and IK

Post by pearcema »

Great! Thank you so much for the suggestion. I will give your suggested approach a try and see how it goes.

Is there any way to detect and prevent the model from becoming unstable, or do you think it won't be an issue so long as the IK setup isn't overly complex?

Thanks again!

coppelia
Site Admin
Posts: 10381
Joined: 14 Dec 2012, 00:25

Re: "Working Bill" and IK

Post by coppelia »

To avoid an IK group becomeing unstable, there are only 2 ways:
  • make sure the various IK elements are correctly defined and not over/under-constrained.
  • use a damped resolution method, with a large damping value.
Cheers

Post Reply