Joint Control: Direct Joint Control
Welcome to this tutorial series in robotics powered by the BOW SDK. This is Direct Joint Control
There are no specific robot recommendations for this Tutorial so we suggest:
- LewanSoul - xArm
Prerequisites
Before trying these tutorials, make sure you have followed the instructions from the to set up the development environment for your chosen programming language.
These tutorials also assume you have installed the BOW Hub available for download from https://bow.software and that you have subscribed with a Standard Subscription (or above) or using the 30 day free trial which is required to simulate robots.
Proprioception and Direct Joint Control
In this tutorial we will focus on how to directly control the individual joints of a robot (as opposed to controlling using inverse kinematics). In order to achieve this we first need to understand the joints that the robot possesses, this can be done using the proprioception modality.
The proprioception modality is a sensory modality sent to the client from the robot, it contains information about each joint of the robot, including its current position/angle, minimum and maximum angles and more. In this example we will create a GUI which populates a list of controllable joints using this information and allows you to control each joint using a slider. This implementation means that the application will be robot agnostic, with the gui being dynamically generated based on the connected robot.
In order to directly control a robots joints you need to use the motor modality. In each motor sample you send, you must specify the control mode as "USE_DIRECT_JOINTS". You can then add joint commands to the RawJoints list of the motor sample. These joint commands must contain the name of the joint you wish to control (can be obtained from proprioception) and a control target, in this case position, but it could also be velocity, acceleration, torque or a combination of these controls. The motor sample can then be sent to the robot using the set modality function, at which point the driver will control the robot as desired.
Running the Tutorial
To run the tutorial, navigate to the Direct_Joint_Control
folder within the SDK Tutorials repository that you cloned earlier.
Then navigate to the language that you would like to use
Finally execute the example program according to your languages standards. For python this would be:
Each language folder will contain a README that more specifically explains how to run that program in that specific languages environment. Make sure to check out the github repository here
Interacting with the Tutorial
Once the tutorial is running a GUI interface will appear powered by Tkinter. This interface will contain as many sliders as there are joints for the robot that you are currently connected to.
Try moving the sliders to adjust the robots joint angles in the simulation!
Stopping
To cancel the tutorial program's execution, you can either close the Tkinter dialogue, or you can press Ctrl + C
in the running terminal.