]> defiant.homedns.org Git - ros_wild_thumper.git/commitdiff
addded script to get motor step response
authorErik Andresen <erik@vontaene.de>
Thu, 31 Mar 2016 18:41:45 +0000 (20:41 +0200)
committerErik Andresen <erik@vontaene.de>
Thu, 31 Mar 2016 18:41:45 +0000 (20:41 +0200)
config/razor.yaml
scripts/step_response.py [new file with mode: 0755]

index 5b4869395bb5310e2d53c6376383e2426424e847..48c57b227af349aaafe36598fb5553a27e01ac15 100644 (file)
@@ -23,8 +23,8 @@ magn_z_max: 596
 
 # extended calibration
 calibration_magn_use_extended: true
-magn_ellipsoid_center: [250.567, 49.8387, -698.641]
-magn_ellipsoid_transform: [[0.940458, 0.0129812, 0.0164252], [0.0129812, 0.947417, 0.0255152], [0.0164252, 0.0255152, 0.978453]]
+magn_ellipsoid_center: [252.957, 54.6821, -690.632]
+magn_ellipsoid_transform: [[0.953315, 0.00715770, 0.00266159], [0.00715770, 0.931906, 0.0360847], [0.00266159, 0.0360847, 0.979971]]
 
 # AHRS to robot calibration
 imu_yaw_calibration: 0.0
diff --git a/scripts/step_response.py b/scripts/step_response.py
new file mode 100755 (executable)
index 0000000..9f74ab9
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-15 -*-
+
+import struct
+from time import sleep
+from i2c import i2c_write_reg, i2c_read_reg
+
+
+def set_pwm(val):
+       i2c_write_reg(0x50, 0x1, struct.pack(">H", val))
+       i2c_write_reg(0x50, 0x3, struct.pack(">H", val))
+       i2c_write_reg(0x50, 0x5, struct.pack(">H", val))
+       i2c_write_reg(0x50, 0x7, struct.pack(">H", val))
+
+if __name__ == "__main__":
+       set_pwm(210)
+       sleep(3)
+       set_pwm(0)