Skip to content

Errors

This page contains information on all functions present within error.py and aims to give a clear understanding both of what these functions do and the requirements for any data to be input into them.

These functions mostly relate to getting information for a variety of different errors and cleaning up errors when they have been dealt with.

Functions

arm_errors

Source code in actions\error.py
  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
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
class arm_errors():

    def __init__(self, arm:XArmAPI):
        self.arm = arm

    def get_err_warn_code(self, show=False, lang='en'):
        """
        Get the controller error and warn code

        Args:
            show: show the detail info if True

            lang: show language, en/cn, degault is en, only available if show is True

        Returns:
            out (tuple[int, list]): tuple((code, [error_code, warn_code])), returned result is only corrent when code is 0.

            code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

            error_code (int): See the [Controller Error Code Documentation](./xarm_api_code.md#controller-error-code) for details.

            warn_code (int): See the [Controller Warn Code Documentation](./xarm_api_code.md#controller-warn-code) for details.
        """
        return self.arm.get_err_warn_code(show=show, lang=lang)

    def clean_error(self):
        """
        Clean the error, need to manually enable motion(arm.motion_enable(True)) and set state(arm.set_state(state=0)) after error cleaned

        Returns:
            code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.
        """
        return self.arm.clean_error()

    def get_c31_error_info(self):
        """
        Get collision error (C31) info

        Note:
            Only available if firmware_version >= 2.3.0

        Returns:
            out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

            code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

            err_info (list): [servo_id, theoratival tau, actual tau]
        """
        return self.arm.get_c31_error_info()

    def get_c37_error_info(self, is_radian=None):
        """
        Get payload error (C37) info

        Note:
            Only available if firmware_version >= 2.3.0

        Returns:
            out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

            code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

            err_info (list): [servo_id, angle]
        """
        return self.arm.get_c37_error_info(is_radian)

    def get_c23_error_info(self, is_radian=None):
        """
        Get joint angle limit error (C23) info

        Note:
            Only available if firmware_version >= 2.3.0

        Returns:
            out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

            code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

            err_info (list): [[servo_id, angle], ...]
        """
        return self.arm.get_c23_error_info(is_radian)

    def get_c24_error_info(self, is_radian=None):
        """
        Get joint speed limit error (C24) info

        Note:
            Only available if firmware_version >= 2.3.0

        Returns:
            out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

            code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

            err_info (list): [servo_id, speed]
        """
        return self.arm.get_c24_error_info(is_radian)

    def get_c60_error_info(self):
        """
        Get linear speed limit error (C60) info

        Note:
            1. Only available if firmware_version >= 2.3.0
            2. Only available in mode 1

        Returns:
            out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

            code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

            err_info (list): [max_linear_speed, curr_linear_speed]
        """
        return self.arm.get_c60_error_info()

    def get_c38_error_info(self, is_radian=None):
        """
        Get joint hard angle limit error (C38) info

        Note:
            Only available if firmware_version >= 2.4.0

        Returns:
            out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

            code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

            err_info (list): [(servo_id, angle), ...]
        """
        return self.arm.get_c38_error_info(is_radian)

    def get_c54_error_info(self):
        """
        Get Six-axis Force Torque Sensor collision error (C54) info

        Note:
            Only available if firmware_version >= 2.6.103

        Returns:
            out: tuple((code, err_info)), returned result is only corrent when code is 0.

            code: See the [API Code Documentation](xarm_api_code.md#api-code) for details.

            err_info: [dir, tau threshold, actual tau]
        """
        return self.arm.get_c54_error_info()

clean_error()

Clean the error, need to manually enable motion(arm.motion_enable(True)) and set state(arm.set_state(state=0)) after error cleaned

Returns:

Name Type Description
code int

See the API Code Documentation for details.

Source code in actions\error.py
28
29
30
31
32
33
34
35
def clean_error(self):
    """
    Clean the error, need to manually enable motion(arm.motion_enable(True)) and set state(arm.set_state(state=0)) after error cleaned

    Returns:
        code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.
    """
    return self.arm.clean_error()

get_c23_error_info(is_radian=None)

Get joint angle limit error (C23) info

Note

Only available if firmware_version >= 2.3.0

Returns:

Name Type Description
out tuple[int, list]

tuple((code, err_info)), returned result is only corrent when code is 0.

code int

See the API Code Documentation for details.

err_info list

[[servo_id, angle], ...]

Source code in actions\error.py
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
def get_c23_error_info(self, is_radian=None):
    """
    Get joint angle limit error (C23) info

    Note:
        Only available if firmware_version >= 2.3.0

    Returns:
        out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

        code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

        err_info (list): [[servo_id, angle], ...]
    """
    return self.arm.get_c23_error_info(is_radian)

get_c24_error_info(is_radian=None)

Get joint speed limit error (C24) info

Note

Only available if firmware_version >= 2.3.0

Returns:

Name Type Description
out tuple[int, list]

tuple((code, err_info)), returned result is only corrent when code is 0.

code int

See the API Code Documentation for details.

err_info list

[servo_id, speed]

Source code in actions\error.py
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
def get_c24_error_info(self, is_radian=None):
    """
    Get joint speed limit error (C24) info

    Note:
        Only available if firmware_version >= 2.3.0

    Returns:
        out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

        code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

        err_info (list): [servo_id, speed]
    """
    return self.arm.get_c24_error_info(is_radian)

get_c31_error_info()

Get collision error (C31) info

Note

Only available if firmware_version >= 2.3.0

Returns:

Name Type Description
out tuple[int, list]

tuple((code, err_info)), returned result is only corrent when code is 0.

code int

See the API Code Documentation for details.

err_info list

[servo_id, theoratival tau, actual tau]

Source code in actions\error.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
def get_c31_error_info(self):
    """
    Get collision error (C31) info

    Note:
        Only available if firmware_version >= 2.3.0

    Returns:
        out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

        code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

        err_info (list): [servo_id, theoratival tau, actual tau]
    """
    return self.arm.get_c31_error_info()

get_c37_error_info(is_radian=None)

Get payload error (C37) info

Note

Only available if firmware_version >= 2.3.0

Returns:

Name Type Description
out tuple[int, list]

tuple((code, err_info)), returned result is only corrent when code is 0.

code int

See the API Code Documentation for details.

err_info list

[servo_id, angle]

Source code in actions\error.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
def get_c37_error_info(self, is_radian=None):
    """
    Get payload error (C37) info

    Note:
        Only available if firmware_version >= 2.3.0

    Returns:
        out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

        code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

        err_info (list): [servo_id, angle]
    """
    return self.arm.get_c37_error_info(is_radian)

get_c38_error_info(is_radian=None)

Get joint hard angle limit error (C38) info

Note

Only available if firmware_version >= 2.4.0

Returns:

Name Type Description
out tuple[int, list]

tuple((code, err_info)), returned result is only corrent when code is 0.

code int

See the API Code Documentation for details.

err_info list

[(servo_id, angle), ...]

Source code in actions\error.py
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
def get_c38_error_info(self, is_radian=None):
    """
    Get joint hard angle limit error (C38) info

    Note:
        Only available if firmware_version >= 2.4.0

    Returns:
        out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

        code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

        err_info (list): [(servo_id, angle), ...]
    """
    return self.arm.get_c38_error_info(is_radian)

get_c54_error_info()

Get Six-axis Force Torque Sensor collision error (C54) info

Note

Only available if firmware_version >= 2.6.103

Returns:

Name Type Description
out

tuple((code, err_info)), returned result is only corrent when code is 0.

code

See the API Code Documentation for details.

err_info

[dir, tau threshold, actual tau]

Source code in actions\error.py
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
def get_c54_error_info(self):
    """
    Get Six-axis Force Torque Sensor collision error (C54) info

    Note:
        Only available if firmware_version >= 2.6.103

    Returns:
        out: tuple((code, err_info)), returned result is only corrent when code is 0.

        code: See the [API Code Documentation](xarm_api_code.md#api-code) for details.

        err_info: [dir, tau threshold, actual tau]
    """
    return self.arm.get_c54_error_info()

get_c60_error_info()

Get linear speed limit error (C60) info

Note
  1. Only available if firmware_version >= 2.3.0
  2. Only available in mode 1

Returns:

Name Type Description
out tuple[int, list]

tuple((code, err_info)), returned result is only corrent when code is 0.

code int

See the API Code Documentation for details.

err_info list

[max_linear_speed, curr_linear_speed]

Source code in actions\error.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
def get_c60_error_info(self):
    """
    Get linear speed limit error (C60) info

    Note:
        1. Only available if firmware_version >= 2.3.0
        2. Only available in mode 1

    Returns:
        out (tuple[int, list]): tuple((code, err_info)), returned result is only corrent when code is 0.

        code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

        err_info (list): [max_linear_speed, curr_linear_speed]
    """
    return self.arm.get_c60_error_info()

get_err_warn_code(show=False, lang='en')

Get the controller error and warn code

Parameters:

Name Type Description Default
show

show the detail info if True

False
lang

show language, en/cn, degault is en, only available if show is True

'en'

Returns:

Name Type Description
out tuple[int, list]

tuple((code, [error_code, warn_code])), returned result is only corrent when code is 0.

code int

See the API Code Documentation for details.

error_code int
warn_code int

See the Controller Warn Code Documentation for details.

Source code in actions\error.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def get_err_warn_code(self, show=False, lang='en'):
    """
    Get the controller error and warn code

    Args:
        show: show the detail info if True

        lang: show language, en/cn, degault is en, only available if show is True

    Returns:
        out (tuple[int, list]): tuple((code, [error_code, warn_code])), returned result is only corrent when code is 0.

        code (int): See the [API Code Documentation](xarm_api_code.md#api-code) for details.

        error_code (int): See the [Controller Error Code Documentation](./xarm_api_code.md#controller-error-code) for details.

        warn_code (int): See the [Controller Warn Code Documentation](./xarm_api_code.md#controller-warn-code) for details.
    """
    return self.arm.get_err_warn_code(show=show, lang=lang)