Completely inane Python Questions

Ok, I want to help with some smiple things with GroundControl, but my Python is completely rusty (I will try to beat it into submission before sending pull requests)…

  1. Where are command line arguments parsed? I want to add a switch for “–clean” which starts up without the config file or g-code (it can/should pull data from the machine)?.

  2. Is it OK to add OpenCV to the dependencies? How about the non-free openCV bits?

I’d think you can do anything with your own fork. What are you thinking about doing with it?

I want to be able to load a “background image” onto the canvas – put some markers outside the cutting surface and have OpenCV match the markers and get coordinates so that I can paint the picture onto the canvas.

I figure that would be a good way to be able to “load in any scrap”, take a pic from your cell phone, and see where to put the new part so it can be cut without running into old cuts (less guesstimation of the origin).

I’m going to try it first with some reflectors to see if I can get “conventional” OpenCV to work… if not, I think I can use the SIFT to match images at the corners, but the SIFT stuff is patented with a license to use in “research settings”…

@madgrizzle is right that one of the beautiful things about Git is that you can do absolutely anything on your own fork of the software without worrying about messing up the main version

Here are the steps I would go through.

  1. Make an issue describing the behavior you want to add (I think there actually already might be one) over at . Creating an issue will give use a place to talk about what the right and easiest way to make the changes is. You can add tags like “bug” or “enhancement” or “help wanted” to sort the issue, and you can assign it to yourself to make it clear that you are going to explore it

  2. Look into kivy because it already has some pretty powerful image processing stuff built in that I think will make what you are trying to do not crazy difficult. Kivy is a little bit confusing at first, but it works really well especially across platforms. Check out

  3. Make a pull request to make your changes part of Ground Control!

Once you’ve made an issue feel free to ask any and all questions. The more people who understand the structure of Ground Control the better!

Don’t get me wrong, I love the enthusiasm to do a project like that! Please take it on.
The way I solve it is to have a sheet of ply loaded scaled as a background in my CAD with X0/Y0 centred. I position the parts on the sheet and save the CAD. For new parts I load the same file and position the new parts on free spaces and create the gcode and save again. If you have several , you need to name the plywood sheets similar to the CAD files.

1 Like

Here is the existing issue!

Personally, I’d love to see that and think its a wonderful idea. I have a webcam ceiling of my shed that stares down at the worksurface as it is.

Here’s a thread that discussed the same issues… may want to build from there as that’s a more on-point topic heading :slight_smile:

1 Like

Digging in the archives an interesting find from Ranger. Somehow related :roll_eyes:
phone app

Ok, I’ve made a prototype that kinda works (as in… if your machine is exactly like mine and if you shot the picture at night with a Canon T3i…, it won’t explode). Next step:

  • I think it would go best on a button on the main canvas [Actions][Settings][Background]… but I don’t know how those link back to code – can someone point me to the right direction for how the “Actions” button calls up the “Actions” popup (I saw how the View Menu worked inside the Actions Popup, but I’m not sure how the View Menu knows what it’s supposed to be bolted to)?

Kivy uses a json file to define how all the parts bolt together. It’s called GroundControl.kv The way it works can be a little confusing at first and I’m happy to explain any of it

1 Like