Commit 0d901161 authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

Document calibration process and stop requiring extruder for calibrating arm positions (#12)

parent 1e951efd
# Calibrations
There are two types of calibration files here:
1. rX_cal: The internal calibrations of the arms (done in factory and read from arms - does not need updating).
2. rX_tforms: The transformations of the arms relative to the print bed (may require updating).
## Recalibrating Arms
This is to calibrate the arms - i.e. find their position/transform relative to the print bed.
1. Remove previous readings - delete the entire measurements section from the yaml file
2. Connect to the arm you are calibrating with the various `roslaunch` commands
3. Run Calibrator with the file for the robot you want to update.
```bash
python Calibrator ../calibrations/rX_tforms.yaml
```
4. Use Keyboard controls to take the arm to the 5 positions. The 5 positions are labelled below. The points are relative to each robot.
```
+---------------+---------------+---------------+
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
+---------------+---------------+---------------+
| | | |
| | | |
| | | |
5 | 1 | 2
| | | |
| | | |
| | | |
+---------------+---------------+---------------+
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
4---------------+---------------+---------------3
ROBOT HERE
```
#!/usr/bin/env python
DEBUG = False
DEBUG = True
## Python libraries
import warnings
......@@ -38,7 +38,9 @@ class Calibrator(object):
pos_W: Nx3 sequence of positions to visit for calibration
"""
if self.controller is None:
self.controller = KeyboardController(waitForExtruder=False,timeScale=self.timeScale)
if DEBUG:
print("Creating KeyboardController")
self.controller = KeyboardController(waitForExtruder=False,timeScale=self.timeScale,disableExtruder=True)
nPos = pos_W.shape[0]
......@@ -268,6 +270,8 @@ if __name__=="__main__":
calibData = yaml.load(file,
Loader=yaml.FullLoader)
if DEBUG:
print("Creating Calibrator")
cal = Calibrator()
## Get targets
......
#!/usr/bin/env python
DEBUG = False
DEBUG = True
VERBOSE = True
## Python libraries
......@@ -60,7 +60,7 @@ class Controller(object):
hotend_srv='hotend',
retractionDist_mm=12.0,
retractionSpeed_mmpmin=4800.0,
simulation=False):
disable_extruder=False):
"""
Creates a controller to multiple robot arms. (TODO)
......@@ -78,12 +78,13 @@ class Controller(object):
queue_size=1)
time.sleep(0.1)
if not simulation:
if not disable_extruder:
print("Waiting for Hotend service")
rospy.wait_for_service(hotend_srv)
try:
self.extruderSetTemp_srv = rospy.ServiceProxy(hotend_srv,Hotend)
except rospy.ServiceException as e:
print('Service call failed: {}'.format(e))
try:
self.extruderSetTemp_srv = rospy.ServiceProxy(hotend_srv,Hotend)
except rospy.ServiceException as e:
print('Service call failed: {}'.format(e))
# initialise MoveIt commander
moveit_commander.roscpp_initialize(sys.argv)
......@@ -102,7 +103,7 @@ class Controller(object):
self.extruderReady = False
# Start extruder
if not simulation:
if not disable_extruder:
self.set_extruder_temp(extruderTemp_C)
if blocking:
self.wait_extruder_ready()
......
#!/usr/bin/env python
DEBUG = False
DEBUG = True
VERBOSE = True
## Python libraries
......@@ -36,12 +36,17 @@ class KeyboardController(Controller):
def __init__(self,
homeConf_deg=np.array([-90,-90,45,-45,-90,-45]),
waitForExtruder=True,
timeScale=1.0):
timeScale=1.0,
disableExtruder=False):
"""
"""
if DEBUG:
print("Creating Controller")
super(KeyboardController,self).__init__(
timeScale=timeScale,
blocking=waitForExtruder)
blocking=waitForExtruder,
disable_extruder=disableExtruder)
# 1x6
homeConf_rad = np.deg2rad(homeConf_deg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment