With this command you can read or set the toolhead length. For accurate readings of x, y, z coordinates of the robot, the toolhead length should be set to the correct value for use in forward kinematics calculations inside the controller. The response returned from the controller is the toolhead length. This command always runs in the high priority queue and upon being received by the controller, all other commands in the controller will be deleted.
Key, value pairs
Key
Value
Required
Description
"cmd"
"toollength"
Yes
Changes the toolhead length.
"id"
Int (>0)
No
Id can be any positive integer. If id is not provided, status of the command will not be returned from the controller.
"toollength"
Double (>0)
No
Toolhead length in mm. If this parameter is not present, the current value of the toollength will be returned and other commands in the controller wont be removed.
Response
Key
Value
Description
"cmd"
"toollength"
In response to toollength command a response is returned with cmd field set to toollength which includes the current length of the toolhead.
"id"
Int (>0)
Same id as the original command.
"toollength"
Double (>0)
The current value of the toolhead length.
Example
{"cmd":"toollength","id":1, "toollength":22}
This command will set the toolhead length to 22mm. It will return a response as follows: