ax_12w.py 2.42 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

from dynamixel.servo import Servo, Row, IndirectRow
import dynamixel.protocol

class AX_12W(Servo):
    EEPROM = [
        Row(name='model_number', address=0, size=2, default=300),
        Row(name='firmware_version', address=2, size=1, default=None),
        Row(name='id', address=3, size=1, default=1),
        Row(name='baud_rate', address=4, size=1, default=1),
        Row(name='return_delay_time', address=5, size=1, default=250),
        Row(name='cw_angle_limit', address=6, size=2, default=0),
        Row(name='ccw_angle_limit', address=8, size=2, default=1023),
        Row(name='temperature_limit', address=11, size=1, default=70),
        Row(name='min_voltage_limit', address=12, size=1, default=60),
        Row(name='max_voltage_limit', address=13, size=1, default=140),
        Row(name='max_torque', address=14, size=2, default=1023),
        Row(name='status_return_level', address=16, size=1, default=2),
        Row(name='alarm_led', address=17, size=1, default=36),
        Row(name='shutdown', address=18, size=1, default=36)
    ]
    RAM = [
        Row(name='torque_enable', address=24, size=1, default=0),
        Row(name='led', address=25, size=1, default=0),
        Row(name='cw_compliance_margin', address=26, size=1, default=4),
        Row(name='ccw_compliance_margin', address=27, size=1, default=4),
        Row(name='cw_compliance_slope', address=28, size=1, default=64),
        Row(name='ccw_compliance_slope', address=29, size=1, default=64),
        Row(name='goal_position', address=30, size=2, default=None),
        Row(name='moving_speed', address=32, size=2, default=None),
        Row(name='torque_limit', address=34, size=2, default=None),
        Row(name='present_position', address=36, size=2, default=None),
        Row(name='present_speed', address=38, size=2, default=None),
        Row(name='present_load', address=40, size=2, default=None),
        Row(name='present_voltage', address=42, size=1, default=None),
        Row(name='present_temperature', address=43, size=1, default=None),
        Row(name='registered', address=44, size=1, default=0),
        Row(name='moving', address=46, size=1, default=0),
        Row(name='lock', address=47, size=1, default=0),
        Row(name='punch', address=48, size=2, default=32)
    ]
    PROTOCOL = dynamixel.protocol.Protocol1

    def __init__(self, id):
        super(AX_12W, self).__init__(
            id=id, eeprom=self.EEPROM, ram=self.RAM, protocol=self.PROTOCOL)