
ezrobot3
Singapore
Asked
— Edited

Hi Everyone,
I would like to enquire if the EZ-Script is able to program the robot in such a way that..
- Detect red/green object
- Move towards the object
- Stop before the object (Around 3-5cm where it will be able to grab hold of the object)
Is it possible? I would have to use the multi-color detection for detecting both colors (Red and Green).
Thanks and would really hope to receive a reply soon.
@Justin, couldn't load chaseandgrip.
It wouldn't load or you couldn't download it?
There is a problem with the link but it should be available here (took a bit of finding since the user details pages are also slightly broken too - a bug that has been reported previously).
@Rich Does this script work this way?
Move the servo connected to D2 into position 70 [D2 is the left arm] Camera will start
It will enable the movement tracking if the camera is tracking. THEN :loop will be the start of the loop
If the image is vertical in the middle, the movement tracking will be disable, and the multicolor tracking will be enable.
(Ps because I do not have the camera rolling yet, so the name 'Custom Color' is Red) If the object is red, the servo D9 and D12 will be moved forward and stop before the object after which, it will then open D4 (which is the gripper) to position 150 then Move the servo connected to D2 into position 40 (to lower from position 70), D4 will then be close back to position 30.
Same for the green object, however, left arm will be used to pick up red object and right arm will be used to pick up green object.
Wait for 9 seconds and then loop back If it isn't vertically it will just loop back It will then repeat the IF nest.
Ps. Is my EZ-Script correct? The flow I wanted was to: Use the camera to track the environment and then detect the object. Next, move towards the object then pick up using either left or right arm depending on whether it is red or green in color.
Thank you very much.
I only had chance to quickly scan over it but I think you've got the main idea.
One thing I noticed though,
This will not do anything, well, not for very long anyway. Almost immediately after moving the servos forwards it stops them. I didn't have chance to see what you are attempting to achieve so can't advise too well but either a sleep() to let it move forward for a set time or a WaitForChange() (or similar) to let it move until an event happens between the forward and stop commands should work.
When I get home I'll look properly. To be honest I don't think EZ-Script is needed since there are built in controls that may do it all for you, or at least the main parts. But I'll have a look later and post some more advice etc.
@Rich Thanks for the reply! Roughly what I want to do is that, the robot will be able to detect the red/green object, and move towards that and after which pick the object up depending on which color. (left hand pick red object, right hand pick green object)
Looking forward to your guidance!
Thank you! (:
Sorry, I haven't forgotten this I just haven't had chance to sit down with ARC and check it out properly - I will.