Open
Description
I've been working with ev3-dev for the past weeks and successfully configured various sensors and actuators. However I can't get the Actuonix Linear Actuator working.
When I try to initialize the class, it says the motor is not connected.
I checked for the driver and it is there:
robot@ev3dev:~$ cat /sys/bus/lego/drivers/ev3-motor/driver_names
lego-nxt-motor lego-ev3-l-motor lego-ev3-m-motor act-l12-ev3-50 act-l12-ev3-100
I have changed the port and the cable just in case and had no luck.
When I create a simple Motor class in that port It uses the lego-ev3-l-motor driver.
Using that it responds to the on(vel) command, going both ways and stopping on the edges. I can't use stop() (it does nothing) and when asked for position it says 0 or 1 being fully retracted or fully extended.
Really hope for some help! Thanks
Desktop :
- OS and version: Ubuntu 18.04
- Connection Type: Wi-Fi
- Software: ssh
Robot:
- Device: Ev3
ev3dev-sysinfo -m output:
Image file: ev3dev-stretch-ev3-generic-2019-10-23
Kernel version: 4.14.117-ev3dev-2.3.4-ev3
Brickman: 0.10.2
BogoMIPS: 148.88
Bluetooth:
Board: board0
BOARD_INFO_HW_REV=8
BOARD_INFO_MODEL=LEGO MINDSTORMS EV3
BOARD_INFO_ROM_REV=6
BOARD_INFO_SERIAL_NUM=00165365FFCA
BOARD_INFO_TYPE=main
Metadata
Metadata
Assignees
Labels
No labels
Activity
dlech commentedon Apr 14, 2020
Using a
LegoPort
object it is possible to override the detected device. There is a similar example for how to do this with sensors at https://github.com/ev3dev/ev3dev-lang-python-demo/blob/stretch/platform/brickpi3-motor-and-sensor.py.In your case
port.set_device = 'act-l12-ev3-100'
should do the trick.trinidadg commentedon Apr 14, 2020
Hi, thank you for your immediate answer!
I created this scipt:
But when i run it i get this error:
And results in:
dlech commentedon Apr 14, 2020
Try adding a time delay between
set_device
andActuonixL12100Motor
as in the linked example.trinidadg commentedon Apr 14, 2020
Tried that and I keep getting the same error. Changed the time delay up to 20 seconds just in case it was being slow, but nothing.
dlech commentedon Apr 14, 2020
OK, I think this is a bug in the python library then.
linear9
should probably bemotor9
. You can check for sure in a SSH terminal.WasabiFan commentedon Apr 14, 2020
Is the
count_per_rot
attribute omitted for linear actuators? If not, it definetely looks like a library bug somehow.dlech commentedon Apr 14, 2020
It's been a long time. My memory is probably faulty 😉 Better check the docs: http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-stretch/motors.html#tacho-motor-subsystem
So maybe
linear
is right and the attributes are slightly different.WasabiFan commentedon Apr 14, 2020
I suspect it is trying to cache
count_per_rot
on initialization and failing because it doesn't exist... I'll take a look at this today.trinidadg commentedon Apr 14, 2020
It's called linear
the output for
is
so the attributes are different, but i don't know why it tries to get
cout_per_rot
WasabiFan commentedon Apr 14, 2020
Yeah, the issue is here: https://github.com/ev3dev/ev3dev-lang-python/blob/ev3dev-stretch/ev3dev2/motor.py#L425
When we restructured speed unit handling we entirely missed the linear actuator case which lacks that attribute. Right now we have speed units which know how to work for rotational motors but not for linear actuators. I'm inclined to go with the simpler solution of not supporting speed units other than percentages with linear actuators; I'll implement it and we can go from there.
@trinidadg if you'd like an immediate workaround, this should work:
And then don't try to use
SpeedUnit
s other thanSpeedPercent
😆 If you are also using normal rotational motors and would like them to continue working as they currently do, you can (or I can show you how to) replacereturn 1
with a try/catch which tries the original property and returns 1 if it doesn't work.Fix error upon construction of linear motor objects
WasabiFan commentedon Apr 15, 2020
@trinidadg Would you be up to test out my fix from #734? If your EV3 has Internet access, you can do the following:
This should install the development version and you can import/use the library as normal. If you are able to test this, please do let me know how it goes! I tested to confirm normal rotational motors still work but I don't have any linear ones to try.
To undo the installation of the development version, run
sudo apt-get --reinstall install python3-ev3dev2
.trinidadg commentedon Apr 15, 2020
The make failed with this error:
trinidadg commentedon Apr 15, 2020
For some reason, the instruction
p.set_device = 'act-l12-ev3-100'
stopped working for me.The output error is:
It worked fine for a while but now it keeps throwing that error.
dlech commentedon Apr 15, 2020
Check the mode of the port. Only certain modes allow
set_device
.WasabiFan commentedon Apr 17, 2020
@trinidadg I haven't gotten a chance to look into the installation error you posted; for our purposes though you can replace line 10 (the middle line below) in
setup.py
as a workaround: