New Possibe Plugin/feature Request. Clicksteer?

 
#1

I had briefly touched on this in one of my other threads.... Anyway, I thought of a good idea (well, I think so anyway) for a plugin or new feature for the camera control... Click steer.... So what it would do is if you have a pan and tilt setup with the ezb4 camera you would be able to click on an area of the camera image the x and y servo would move to centre in on the area you clicked.... For example you click on the top left corner of your camera's image, the x and y servo would attempt to centre the camera on the top left corner of the image...

Also, you can use the same principal to steer the robot while it is moving forward... Click left on the camera image and the robot will steer proportionally to the left depending how far left in the image you clicked... And of course same for the right... So steering the robot using your mouse and camera image...

I could probably hack something up using the plugin Remote mouse... However that would mean I could never move the camera control or it would throw everything off...

#2

That's a good idea - but don't use the remote mouse. You would use any of the overlay plugins. On the panel which displays the image is an event called "OnMouseClick". You simply need to grab the coordinates of the mouse click and perform the appropiate command (move servo or steer). Of course steering can only be done using the HBridge with PWM. And because every robot is different, you would require many values to adjust/tweak for the turning speeed which is relative to the robot speed. Every robot will have a different speed. Also, same applies with clicking on the window to move servos for focus. This would require some math to calculate the number of degrees based on the servo lever.

Wouldn't be too hard Smile Give it a shot!

#3

Ok.... I will see what I can come up with.... Cheers Smile

#4

nice!

#5

Ok, so to be clear... I need to download your example camera overlay and tweak the Visual Studio example to extract the "OnMouseClick" x and y coordinates? Ha, ha... I'll give it a shot. I'll load your example into visual studio and poke around and see if my seriously limited (actually pretty much none existent) C# abilities can do this.... Assuming I can alter the plugin to accomplish this, would I need to publish it as a new plugin?

#6

Correct Smile

You would need to publish it as a new plugin if you wish to share it with others. Either way, it requires a unique guid, etc..

#7

Crap my 30 day trial version of VS has expired so I can't load the project....... Did I hear you mention there was a free version somewhere?

#8

Free version is called Community Edition

https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx

Thia is very similar to something I want to achieve, although more autonomous. I want to recognize an object. By a combination of pan/tilt and robot poaition adjustments drive towards it, adjusting the camera as I get closer so it is always centered in view. When the camera position indicates I have reached the object, execute an autoposition action to have an arm pick up the object.

I have been struggling with how to script this, and now think a plugin may be the way to go.

Alan

#9

Hey @Alan... I guess I need to remove my 30day trial version first before I install the one you linked to?

#10

Probably, yes.

Alan