MATLAB: A body of the RigidBodyTree cant be found

addbodyhomogeneous coordinatesinversejointkinematicsmodelrigidbodytreeroboticssetfixedtransform

Hello, i dont know what is wrong with the attached script because i just followed the tutorial build a kinematic model, but im always told the error "Body with name body1 is not found. Check the BodyNames property of the RigidBodyTree object to get a list of body names."
What should i do so that matlab can find that body please?

Best Answer

The third parameter of addBody needs to be the name of the parent body, not the name of the body itself. The body knows its own name. So
addBody(PHA9, body1, 'body0')