[Python] Stop a movement

Hi !
There is solution to stop the arm when he is moving with the python library in the 4.1 version Firmware ?

Hi, the firmware 4.1 dose not support stop while moving.

Which version of the firmware support this feature ?

No firmware of uArm Swift Pro support that function, you could use “!” to pause the movement but could not stop the movement.

Hi Daniel,

Is it possible to add this feature where we can abort commands?

Regards
Praveen

As ram stated, is this possible and can it be done quickly?

Possibility? I haven’t done this myself and will not write the code for you. :slight_smile:

Using just the existing python SDK, write a wrapper function for the set_position. Within that wrapper function, make a vector from your current position to target position. Do 1 mm motions (or whatever increment you think is good) in a for loop from current to target position. Allow keyboard input break the for loop and thus stop motion. You need sleep between motions, otherwise all motion will be queue, I think.

Or if you looking to see if there is a collision, run the get_position after each increment. If the get_position doesn’t get closer, then you collided with something break the for loop.

I’m controlling it via matlab to do some image processing and recognition for shapes and etc.

I have written a function in matalab that runs a while loop which does bring it down by 1mm at a time unless the limit switch goes off which works but the jittiness and slowness of it looks alittle meh tbh lol

I was hoping there was a way to cancel a movement thats already in progress.

The uarm runs on gcode, a CNC language, which I don’t think at its core allows realtime adjustments.

My guess is that the jittering that you see is from moving at the fastest speed and then stopping from the fastest speed. Since you are only going 1mm or less increments, you can go slower and that might stop the jittering.

If you moving a long distance, it will be slow going in 1 mm increments. You could go bigger increments at the start and save your 1mm increments when you really need it. Half the distance, half of that and half of that and etc.

I’m now editing the firmware that compiles via the arduino software and I think I have it working hehe!

Once I get it going well, ill post the changes I made for people in the future to use.

Nice, I’d like to see that. :slight_smile:

Just doing tests to make sure it works though :stuck_out_tongue:!

Well I got it working it seems, will need more testing but im happy with it so far!

Is there any chance you can post your code and what worked for you?

Thanks