[FARMWARE] Selfie

Want to take a picture of your veggies, but have thought luck like me? Here is the help

Thank you,
Eugene

4 Likes

This is how mine looks like.
It used to be better when the plants were shorter. Stitching a nice picture of a tall plant out of several small shots seems to be an impossible task. I am thinking to enhance this farmware so it creates a base layer from a quilt of small shots and then overlay it with a one shot per pant (taking into consideration it’s spread)

3 Likes

Nice one Eugene! I can’t get it to work however. It gives me the error “[Selfie] Something went wrong: Unable to find sequence TAKE A PHOTO, create one!”. Now, I have indeed, created such a sequence. I have tried variations on the Capitalization and CAPITALIZATION. Would it be too much to ask to have field where we can specify the name? Or tell us in the readme the name the sequence has to be?

this time I indeed forgot to make it case insensitive. fixed in 1.0.2

Thank you for report!
Eugene

Thanks for the update Eugene! My current error is "Something went wrong: ‘selfie_cache’. Any thoughts on how I would correct this?

hmm… this looks like my error, but I am not able to reproduce it and I analyzed all places where selfie_cache is used and this error shall not be generated. Will play more with it.

May be Python experts will take a look as well?

Thank you,
Eugene

Its not your error, you can reproduce it by entering the values that @fuzzynickel entered.

@fuzzynickel try to change your values like this:
COORDINATE OF TOP RIGHT CORNER : (0,0)
COORDINATE OF BOTTOM LEFT CORNER: (2768,1269)
SUGGESTED STEP SIZE: (150,150)

Just as a clarification how this farmware is set up (@etcipnja correct me if I am wrong):

COORDINATE OF TOP RIGHT CORNER is the value, where your first picture will be made, basically your starting point. You can determine this position if you know how big your photo will be. So take a photo in the right position and take the coordinates of the top right corner, in my case its (320,230) as you can see in this spoiler:

Summary


COORDINATE OF BOTTOM LEFT CORNER is pretty simple, just your max bed dimensions. If you dont know them for sure, you can calculate them easily like this: Axis length / Step size → 13823/5=2765.


SUGGESTED STEP SIZE describes the space between the images, so it stands for the size of each picture. You can take a picture in the middle of nowhere and measure the space that the image takes in the bed. I think this value is usually also the same as COORDINATE OF TOP RIGHT CORNER.

I attempted your suggestion Ascend, and got some positive results. However, it ultimately ended in failure. See below. I think the Farmware could not handle what happens when the current position + step size is greater than the max position. Some of this was due to the ‘drift’ that is occurring during movement (it’s a few mm per movement). I’ll play with some smaller values and see if I can get some success. Should the FB Selfie farmware be ‘aware’ of max position? Or is that the responsibility of the user? In the case of drift, it does make some sense to shift that responsibility to the farmware, especially since drift can be highly variable. Perhaps skipping that movement along with a log message ‘Skipping movement to (x,y) since it is outside max range (x_max, y_max).’

Eugene, I think a concept worth ruminating over is that there are four possible orientations and home positions (0,0,0) for the Farmbot. For example, when viewing from above: your farmbot’s 0,0,0 location is the top right corner. My FB’s 0,0,0 location is the top left corner. Perhaps this is a variable you can add to the farmware…or you can just say the target users are those who can do the co-ordinate system flipping in their head :stuck_out_tongue:

Awesome Farmware and discussion fellas!

Could you post your farmware values? I assume your max values are x:2768 and y:1269. The bot tried to move to x:2754 which is lower than the max value. In this case the farmware was working great and your bot was not able to reach his position. You could check manually if the bot is able to reach that position at all.

The farmbot instructs the bot to move only in absolute movements, so the position should be completely exact. Drifting should also be detected by the encoders and repositioned after movement.

1 Like

yes, great suggestion. I’ll rename the parameters so they are not confusing to the guys who positioned FB differently than I did

Eugene

@ascend is correct. Your FB failed to reach a point that is inside of the box you provided as an input parameter.
There is nothing I can do about it.

It is probably not a good idea to supply (0,0) - (max_x, max_y) because otherwise you will see a lot of copies of your gantry that moves long with the camera. Your goal is to specify the smallest rectangle inside your raised bed that still gives you the full coverage of the bed. This depends of the camera you are using, its position and bed orientation.

fixed selfie_cache problem in 1.0.3 and updated documentation. Now it shall be clear what input parameters are expected.

Thank you,
Eugene

1 Like

One of the x motors seized during movement and it took manual intervention to unseize it. I attempted again, and once more the motor seized, this time in a different spot. I figured I was asking the FB to do too much, too quickly, so I put a 500ms delay before taking the picture, and after taking the picture. With this modification, the selfie FW finished without an error.

Now, however, I don’t see any photos that were taken in the photo viewer! (I could see the earlier photos from the failed attempts) Where should I be looking for those photos and the resulting stitched together photo?

Normally you shall see photos in the Farm Designer. I assume that you already calibrated the camera. If you did not - you need to follow instruction on FB site to calibrate it. The calibration process might be tricky and confusing. I am thinking to write a post about my experience with it.

I assume that you mean the Farmware site where you can also see the calibration and weed detection widget. Your photos should be visible from there if they were uploaded successfully.

I think there could be two things causing your photos not being uploaded:

  • There was an error when taking the photo that you could see in the logs.
  • The pictures were taken too fast, so the process of uploading was interrupted because the next photo had to be processed.

Hey @etcipnja thanks for that great farmware, it works with my setup quite well!

Any implementation yet that you can choose at the end to take one picture of each plant? :=) This would be superb!

Btw what is the red line in your picture?

Thank you for feedback. I am currently trying to make MLH to do the watering basing on readings from the weather station, pant name and plant age. Will be back to Selfie right after that!

Eugene

1 Like

This red line shows the last movements that the bot did. You can activate it in the account settings.

2 Likes

Another bug report, I realized today that it always makes three pictures at x max. Could you please investiage in that?

Thanks, Best
Klim

Hello,

here is the algorithm:

  1. move to the start position (X,Y)
  2. take a picture
  3. make a step on X
  4. If (X,Y) position still in a box - go to 2
  5. goto start X position and make a step on Y
  6. If (X,Y) position still in a box - go to 2
  7. end

as you can see it never takes a picture in the same position twice. However it makes several pictures at max X position (exactly as many Y steps it makes) but Y position is different every time.

If you see a different behavior - please send logs.

Thank you,
Eugene