This commit is contained in:
28
script/test/RobotCartesianScan.py
Normal file
28
script/test/RobotCartesianScan.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import plotutils
|
||||
from mathutils import fit_gaussian, Gaussian
|
||||
|
||||
robot.enable()
|
||||
move_to_laser()
|
||||
|
||||
#robot.reset_motion("jLaser")
|
||||
|
||||
#import ch.psi.pshell.device.Timestamp as Timestamp
|
||||
#sensor = Timestamp()
|
||||
|
||||
#ret = lscan(robot_z, sensor, -50.0, 0.0, 0.5, latency = 0, relative = True)
|
||||
#ret = lscan(robot_x, sensor, -50.0, 0.0, 0.5, latency = 0, relative = True)
|
||||
|
||||
robot.set_motors_enabled(True)
|
||||
ret = lscan(robot_x, ue.readable, -1.5, 1.5, 0.1, latency = 0.01, relative = True)
|
||||
|
||||
x,y = ret.getPositions(0), ret.getReadable(0)
|
||||
y = [100.0-v for v in y]
|
||||
(norm, mea, sigma) = fit(y, xdata=x)
|
||||
print "Maximum at " + str(mea)
|
||||
|
||||
|
||||
|
||||
robot.set_motors_enabled(True)
|
||||
ret = lscan(robot_rz, ue.readable, 0.0, 40.0, 1.0, latency = 0.01, relative = True, range = "auto")
|
||||
|
||||
|
||||
12
script/test/TestLaserScan.py
Normal file
12
script/test/TestLaserScan.py
Normal file
@@ -0,0 +1,12 @@
|
||||
robot.set_motors_enabled(True)
|
||||
steps_x = 10
|
||||
steps_y = 8
|
||||
#ret = ascan([robot_x, robot_z], ue.readable, [-10.0, -10.0], [10.0, 10.0], [10,10], latency = 0.01, relative = True , zigzag=True)
|
||||
ret = ascan([robot_x, robot_z], ue.readable, [-10.0, -10.0], [10.0, 10.0], [steps_y,steps_x], latency = 0.01, relative = True , zigzag=False)
|
||||
data = Convert.transpose(Convert.toBidimensional(to_array(ret.getReadable(0),'d'),steps_x+1,steps_y+1))
|
||||
plot(data, title="data")
|
||||
|
||||
data = ret.getData(0)
|
||||
plot(data, title="data2")
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ print robot.get_emergency_stop_sts()
|
||||
print robot.get_safety_fault_signal()
|
||||
print robot.stop()
|
||||
print robot.resume()
|
||||
print robot.resetMotion()
|
||||
print robot.reset_motion()
|
||||
print robot.is_empty()
|
||||
print robot.is_settled()
|
||||
print robot.get_move_id()
|
||||
|
||||
@@ -30,7 +30,7 @@ try:
|
||||
step = 11
|
||||
robot.resume()
|
||||
step = 12
|
||||
robot.resetMotion()
|
||||
robot.reset_motion()
|
||||
step = 13
|
||||
robot.is_empty()
|
||||
step = 14
|
||||
|
||||
Reference in New Issue
Block a user