Using Joint target position with Python Coppelia API binding
-
- Posts: 2
- Joined: 27 Mar 2024, 18:35
Using Joint target position with Python Coppelia API binding
Good afternoon. How do I use sim.setJointTargetposition to control the joint of a robot arm on Coppelia Python script such that the joint bends to the location I desire?
-
- Posts: 2
- Joined: 27 Mar 2024, 18:35
Re: Using Joint target position with Python Coppelia API binding
I was able to figure out how to do it using angular positioning: 'sim.setJointTargetPosition(fulcrumJoint,300*math.pi/360)' but how do I do so linearly, setting specific x,y,z coordinates?
Re: Using Joint target position with Python Coppelia API binding
Hello,
if you want to control a joint or kinematic chain in 3D space instead of joint space, then you should use inverse kinematics (IK).
In your case, if you want a joint to follows a specific 3D point, try with this exercise:
Cheers
if you want to control a joint or kinematic chain in 3D space instead of joint space, then you should use inverse kinematics (IK).
In your case, if you want a joint to follows a specific 3D point, try with this exercise:
- Make sure your joint (for now) is in kinematics mode
- attach it to an object that you then mark as model base
- Add a dummy to the scene, and attach it to your joint. Rename that dummy to tip
- Copy-paste that dummy and rename it to target. Attach it to the model base.
- Select the model base
- Go to [Menu bar > Modules > Kinematics > Inverse kinematics generator...]
- Uncheck Alpha+Beta and Gamma
- Set the Damping factor to e.g. 2
- Click Generate
Cheers