elephantrobotics / pymycobot

This is a python API for ElephantRobotics product.
MIT License
107 stars 54 forks source link

Exception in Tkinter Callback During myCobot 280 Pi Calibration #54

Closed jhordanhiro closed 4 months ago

jhordanhiro commented 6 months ago

Description

I am encountering an issue with my myCobot 280 Pi during the calibration process. The error occurs when running the rasp_mycobot_test_gui.py script. The script fails with a Tkinter callback exception. This issue is preventing me from completing the calibration process.

Steps to Reproduce

  1. Ran the rasp_mycobot_test_gui.py script on a Raspberry Pi connected to myCobot 280 Pi.
  2. Selected the appropriate serial port (/dev/ttyAMA0) and baud rate (115200 or 1000000). // I tried to use both
  3. Attempted to calibrate the robot arm by clicking the "Start Calibration" button.

docs.elephantrobotics.com/docs/gitbook-en/4-BasicApplication/4.2-firmwares_intro/4.2.2-calibration/4.2.2.2-micro_CPU.html

Expected Behavior

The calibration process should start, and the robot arm should respond accordingly without any errors.

Actual Behavior

An exception is thrown in the Tkinter callback when the calibration function is invoked. The detailed error message is as follows:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.8/tkinter/__init__.py", line 1892, in __call__
    return self.func(*args)
  File "rasp_mycobot_test_gui.py", line 216, in calibration_mycobot
    self.mycobot.send_angle(self.calibration_num, 0, 0)
  File "/home/user/.local/lib/python3.8/site-packages/pymycobot/generate.py", line 246, in send_angle
    self.calibration_parameters(class_name=self.classname, id=id, angle=degree, speed=speed)
  File "/home/user/.local/lib/python3.8/site-packages/pymycobot/error.py", line 295, in calibration_parameters
    public_check(parameter_list, kwargs, robot_limit, class_name, MyCobotDataException)
  File "/home/user/.local/lib/python3.8/site-packages/pymycobot/error.py", line 108, in public_check
    raise exception_class("speed value not right! should be 1 ~ 100, the received speed is 0")
pymycobot.error.MyCobotDataException: speed value not right! should be 1 ~ 100, the received speed is 0

WhatsApp Image 2024-01-19 at 15 32 21

Environment

anla-xu commented 5 months ago

The last parameter of the send_angle interface ranges from 1 to 100. Please modify line 216 of the rasp_mycobot_test_gui.py file and change self.mycobot.send_angle(self.calibration_num, 0, 0) to self.mycobot.send_angle(self.calibration_num , 0, 20)