tutorials/pick_and_place/Scripts_Part4/RealSimPickAndPlace.cs
/// <summary>
///     Find all robot joints in Awake() and add them to the jointArticulationBodies array.
///     Find left and right finger joints and assign them to their respective articulation body objects.
/// </summary>
Find all robot joints in Awake() and add them to the jointArticulationBodies array.
Find left and right finger joints and assign them to their respective articulation body objects.
Find all robot joints in Awake () and add them to the jointArticulationBodies array . Find left and right finger joints and assign them to their respective articulation body objects .
void Awake()
    {
        jointArticulationBodies = new ArticulationBody[NUM_ROBOT_JOINTS];
        string shoulder_link = "world/base_link/shoulder_link";
        jointArticulationBodies[0] = niryoOne.transform.Find(shoulder_link).GetComponent<ArticulationBody>();
        string armLink = shoulder_link + "/arm_link";
        jointArticulationBodies[1] = niryoOne.transform.Find(armLink).GetComponent<ArticulationBody>();
        string elbowLink = armLink + "/elbow_link";
        jointArticulationBodies[2] = niryoOne.transform.Find(elbowLink).GetComponent<ArticulationBody>();
        string forearmLink = elbowLink + "/forearm_link";
        jointArticulationBodies[3] = niryoOne.transform.Find(forearmLink).GetComponent<ArticulationBody>();
        string wristLink = forearmLink + "/wrist_link";
        jointArticulationBodies[4] = niryoOne.transform.Find(wristLink).GetComponent<ArticulationBody>();
        string handLink = wristLink + "/hand_link";
        jointArticulationBodies[5] = niryoOne.transform.Find(handLink).GetComponent<ArticulationBody>();
        string rightGripper = handLink + "/tool_link/gripper_base/servo_head/control_rod_right/right_gripper";
        string leftGripper = handLink + "/tool_link/gripper_base/servo_head/control_rod_left/left_gripper";
        leftGripperGameObject = niryoOne.transform.Find(leftGripper);
        rightGripperGameObject = niryoOne.transform.Find(rightGripper);
        rightGripperJoint = rightGripperGameObject.GetComponent<ArticulationBody>();
        leftGripperJoint = leftGripperGameObject.GetComponent<ArticulationBody>();
    }
void Awake ( ) { jointArticulationBodies = new ArticulationBody [ NUM_ROBOT_JOINTS ] ; string shoulder_link = " " ; jointArticulationBodies [ 0 ] = niryoOne . transform . Find ( shoulder_link ) . GetComponent < ArticulationBody > ( ) ; string armLink = shoulder_link + " " ; jointArticulationBodies [ 1 ] = niryoOne . transform . Find ( armLink ) . GetComponent < ArticulationBody > ( ) ; string elbowLink = armLink + " " ; jointArticulationBodies [ 2 ] = niryoOne . transform . Find ( elbowLink ) . GetComponent < ArticulationBody > ( ) ; string forearmLink = elbowLink + " " ; jointArticulationBodies [ 3 ] = niryoOne . transform . Find ( forearmLink ) . GetComponent < ArticulationBody > ( ) ; string wristLink = forearmLink + " " ; jointArticulationBodies [ 4 ] = niryoOne . transform . Find ( wristLink ) . GetComponent < ArticulationBody > ( ) ; string handLink = wristLink + " " ; jointArticulationBodies [ 5 ] = niryoOne . transform . Find ( handLink ) . GetComponent < ArticulationBody > ( ) ; string rightGripper = handLink + " " ; string leftGripper = handLink + " " ; leftGripperGameObject = niryoOne . transform . Find ( leftGripper ) ; rightGripperGameObject = niryoOne . transform . Find ( rightGripper ) ; rightGripperJoint = rightGripperGameObject . GetComponent < ArticulationBody > ( ) ; leftGripperJoint = leftGripperGameObject . GetComponent < ArticulationBody > ( ) ; }
Find all robot joints in Awake() and add them to the jointArticulationBodies array.
Find all robot joints in Awake () and add them to the jointArticulationBodies array .
// Find left and right fingers