RCareWorld provides interfaces for users to control human joints by name.
The joints in the human body are listed as the following. We follow the naming convention of the SMPL-X human body model. To check where each joint is, you can open one of the human prefabs and see the tree structure in the hierarchy window on the left.
['Pelvis', 'Spine1', 'Spine2', 'Spine3', 'LeftShoulder', 'LeftUpperArm', 'LeftLowerArm', 'LeftHand',
'RightShoulder', 'RightUpperArm', 'RightLowerArm', 'RightHand', 'LeftUpperLeg', 'LeftLowerLeg',
'LeftFoot', 'LeftToes', 'RightUpperLeg', 'RightLowerLeg', 'RightFoot', 'RightToes', 'Neck', 'Head',
'LeftEye', 'RightEye', 'Jaw', 'LeftThumb1', 'LeftThumb2', 'LeftThumb3', 'LeftIndex1', 'LeftIndex2',
'LeftIndex3', 'LeftMiddle1', 'LeftMiddle2', 'LeftMiddle3', 'LeftRing1', 'LeftRing2', 'LeftRing3',
'LeftPinky1', 'LeftPinky2', 'LeftPinky3', 'RightThumb1', 'RightThumb2', 'RightThumb3',
'RightIndex1', 'RightIndex2', 'RightIndex3', 'RightMiddle1', 'RightMiddle2', 'RightMiddle3',
'RightRing1', 'RightRing2', 'RightRing3', 'RightPinky1', 'RightPinky2', 'RightPinky3']
The CareAvatars are configured with realistic Joint parameters. But under certain conditions, you might want to adjust the range of motions, or joint stiffness.
Click on the joint that you want to adjust. In ArticulationBody
, adjust joint limits and stiffness.
You can also change other joint properties in the ArticulationBody
script. Check Unity manual for more details.
We support position control for human joints. The two APIs for controlling human joint positions are:
setJointRotationByName
setJointRotationByNameDirectly
.
Example: See Examples/example_human_joint.py
import os
from pyrcareworld.envs import RCareWorld
# Create environment
env = RCareWorld(executable_file='@Editor', assets=['HumanArticulation'])
# Create human
human = env.create_human(id=123456, name='HumanArticulation', is_in_scene=False)
# Load human
human.load()
# Set human base position
human.setBasePosition([0, 2, 0])
# Get human joint state by name
human.getJointStateByName('Spine1')
env._step()
# Set human joint position by name
human.setJointPoisitionByNameDirectly('Neck', [20,20,20])
human.setJointPoisitionByNameDirectly('Spine2', [20,0,0])
env._step()
# Get human joint state by name
human.getJointStateByName('Spine1')
while 100:
env._step()