Skip to content

Return type of sync_send_angles is int, should not use method chaining. #144

@AkagawaTsurunaki

Description

@AkagawaTsurunaki

Describe the bug
Return type of sync_send_angles is int, should not use method chaining.
See demo/sync.py at line 20-24.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repository (Commit 3506655).
  2. Run python .\demo\sync.py.
  3. Input 3, Enter, Enter.

Expected behavior
The test case should be passed without any exceptions.

Screenshots

--------------------------------------------
| This file will test basic option method: |
|     sync_send_angles()                   |
--------------------------------------------


1 : COM4 - 蓝牙链接上的标准串行 (COM4)
2 : COM3 - 蓝牙链接上的标准串行 (COM3)
3 : COM5 - USB-Enhanced-SERIAL CH9102 (COM5)

Please input 1 - 3 to choice:3
COM5

Please input baud(default:115200):
115200

Wether DEBUG mode[Y/n]:

Start check basic options

Traceback (most recent call last):
  File "...\pymycobot\demo\sync.py", line 46, in <module>
    test(mycobot)
  File "...\pymycobot\demo\sync.py", line 20, in test
    mycobot.sync_send_angles([0, 0, 0, 0, 0, 0], 100).sync_send_angles(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'sync_send_angles'

Desktop:

  • OS: Windows 11
  • Hardware: myCobot 280 M5 2023

Additional context
I fixed it by decomposing the method chaining:

    mycobot.sync_send_angles([0, 0, 0, 0, 0, 0], 100)
    mycobot.sync_send_angles([100, 50, 0, 0, 70, 160], 100)
    mycobot.sync_send_angles([-100,-50, 0, 0, -70,-160], 100)
    mycobot.set_free_mode(1)

I created a PR here but I do not know if it is a proper solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions