You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a school project we are trying to work with the color sensor. We don't understand how to use the implemented functions. We tried the following approach:
from lib.interface import Interface
from serial.tools import list_ports
available_ports = list_ports.comports()
print(f'available ports: {[x.device for x in available_ports]}')
port = available_ports[0].device
bot = Interface(port)
print('Bot status:', 'connected' if bot.connected() else 'not connected')
bot.set_color_sensor(1, True, port, version="2")
But keep running into a struct.error in the parsers library: "required argument is not an integer". Specifically in line 82.
Did anyone have success with the color sensor or is somehow able to help us?
The text was updated successfully, but these errors were encountered:
I no longer have access to the robot and quite frankly it's been a while since I looked at the code. Could it be that the port you're using is intended to be a dobot port number, rather than the serial port? Since the bot instance already has knowledge of the port, I can't see why I would have a function taking that as an argument again. Try with values like 0, 1 or something and see if that correlates to a port on the robot.
Thank you for the quick response! We are working with the Dobots again right now and you were absolutely right. I had to use the dobot port number. The remaining problem we have is that the color sensor alwways returns (0, 0, 1) or (0, 1, 0). We are trying to figure out wether this comes from the index argument in the function or the sensor itself.
For a school project we are trying to work with the color sensor. We don't understand how to use the implemented functions. We tried the following approach:
But keep running into a struct.error in the parsers library: "required argument is not an integer". Specifically in line 82.
Did anyone have success with the color sensor or is somehow able to help us?
The text was updated successfully, but these errors were encountered: