shaimaabes
Egypt
Asked
— Edited
Hello , I want to control the JD camera from my visual studio plugin , I've try the following code but it doesn't work EZ_B.Camera.GetVideoCaptureDevices();
plz I need ur help as soon as possible .
All of my plugins are open source, so you can look to see how to do various things.
Look at the source code of this plugin: https://synthiam.com/redirect/legacy?table=plugin&id=50
In order to get the current active camera device, you need to get the current active camera control. The code in that example plugin will scan all controls and get the first instance of a camera control. The "attach" button will attach to the first camera control and use its video frame event.
Make sure you unregister the video frame event when your control disposes or closes.
sample code to connect to an EZB Camera, save the picture in the desktop.
don't forget to change ezbAddress variable to your EZB IP address.
ptp, that is for creating a standalone application. The OP is asking about creating a plugin. A plugin runs in the ARC environment, which will have a project with an existing camera control.
The plugin will search and locate an existing camera control and attach itself to it.
you are right, my bad!
No problem Here's a tutorial step i created for the plugin to use the existing camera control: https://synthiam.com/Tutorials/UserTutorials/146/17
thanks ptp you give my what I need ,that's to control the JD camera from visual studio but i need to control it from my form . would you help me to do that ?
DJ Sures you didn't get what I mean . I need to control the camera from my plugin . I mean ,I want to display what the robot see from my own windows form ,Did you get it ?
you have both examples, standalone application and ARC skill plugin.
There are more advantages if you migrate to an ARC skill plugin: you will have more robust ecosystem, you can mix custom scripting (EZ-Script) you can communicate with other plugins you have more API's, and you have a modular approach, for example breaking a complex problem in multiple plugins.
Also DJ's plugins are open source, so it's easy to improve an existing idea.
Whatever road you choose, it's ok.
If you are using a Form, the standalone code still works, let us know if you need more help.
ptp
yup , i still need ur help . I've run ur code but it gave me the following error in the image ,
for that i asked u to control the camera from my windows form . for example i try to put ur code in a button in my form but unfortunately , it didn't work
ptp image for error
Are you sure that you're creating a plugin? Or a standalone application?
Also, do not use ptp's code. Use the tutorial that i posted.
In the tutorial, to draw on a Panel, for example...
DJ. He is not building an ARC plugin. Needs SDK instructions (I would provide but answering from phone).
If you're not building a plugin, then read the README.TXT that is included in the SDK. You're not following the instructions. All files from the SDK package must be copied into your output folder. Read the instructions.
If you are making a plugin, then read the tutorial and use the code i presented.
Windows Form Application Example code:
https://github.com/ppedro74/ez-robot-form-application
It takes a Picture, displays in the form and it saves to the desktop.
Cheers,
Attention to:
DJ wrote:
Platform target: must be x86 (32 bits)
Some dlls are needed in the application folder you have two options:
copy the dlls "packages/EZ_B.dll.2015.05.20.00" to the application folder i.e. (bin/debug or bin/release)
add application references to the missing dlls: e.g. VS>Project>Add Existing Item>(look for the missing DLL)>ADD VS>Project>dll properties>"Copy to Output Directory" Change to "Copy if newer"
personally i like the option 2, you are aware of the dlls needed, but the safest option is the 1).
thanks ptp for your help ,I appreciate you effort ^_^
hello DJ Sures , plz I need ur code that display what robot see as in the picture
plz send it to me as soon as possible.
It's a jpg file... here it is:
DJ Sures , I need the code that display what robot see not the jpg file sick sick I need the visual studio code
There are samples in the SDK. http://synthiam.com/Products/ARC or http://synthiam.com/Products/ARC
Alan
Or, if it's a plugin as the title says, view any of the examples or the code example that I had already provided to you.
You have more than you need - as there's even code written for you and pasted in this thread. There is literally nothing else anyone can do outside of flying to your city and sitting in front of your keyboard to physically type it. Please use the information provided to you.
You have been very unclear if this is an sdk program or a plugin. The title is misleading to the type of application that you are making. Either way, information for both those has been provided.
*warning: this is your final warning or your account will be banned. You have created second accounts and immaturely created numerous threads on the same topic with multiple accounts. If this behavior continues, your account and ip will be banned. You have a history of doing this on ezrobot forum. Including demanding posts and even posts with pages of emojis. You will be banned from any further simular behavior.
I have removed your other threads from duplicate accounts.
okay DJ Sures but they aren't two account for the same person we're one team in a graduation project & when I failed to get my needs , my team leader ahmed logged in with his account. u can check my LinkedIn account to see that I'm an IT student. thanks for being so aggressive.
note :- we connect our jd robot from this lap & our whole project is on it so, the same IP is normal.
You and your team lead need to work on maturity and respect. Absolutely more assistance than is necessary has been provided to you. There is nothing more humanly possible that can be given to you.
You still have yet to respond to whether the project is sdk or plugin.
sdk code has been presented to you in this thread
sdk package contains nearly 50 examples, most of which contain camera
plugin code has been provided to you in this thread AND the plugin tutorial has been updated to include an entire new section of how to access the camera
plugin and sdk code to draw the camera image to a panel has been provided to you in this thread
@shaimaabes,
Most of us have been students too (in my time it was much more difficult) limited internet, and no money to buy IT books, we hang out in public book stores, reading, copying code & information from store's books until a clerk pointed the exit door.
Windows Form Application Example code post #15: the initial code have everything you need to handle the EZB camera video frames.
i took a small brake to improve the code, please check the github repository.
the code shows video feed in the form application, is not rocket science, but if you have doubts before, i really hope they will be gone.
i had also some extra concurrency code to prevent future issues.
@ptp i should add that the OnNewFrame event will never execute twice. The event is indeed executed on a worker thread (not ui), however it will never execute concurrent or require locks.
If your OnNewFrame event runs for a lengthy time, any new frames that arrive will be skipped. The OnNewFrame event will only be raised when a new frame arrives and there is no current instance of the OnNewFrame event running.
Eng ,@ptp
thanks verrrrrrrrrryyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy muchhhhhhhhhhhhhhhhhhhh for ur kindness & ur smart behavior when u answering me , u are an excellent man , & no words would give u ur value .
yeah nw is mush better for students to learn but u know that sometimes our minds get stopped .
anyway I appreciate ur words , kindness & ur effort
yep, i assumed that
this is a good advice (re quote, to enforce the importance):
the concurrency issues are: OneSecondTimer_Tick (measuring) the fps counter, is a Windows Form Timer so the execution is in the UI thread and changing a counter variable same used for OnFrame event, minor detail to enforce two threads using the same variable.
OnNewFrame, Invoke to the UI/Control/Thread (i assumed it wasn't the ui thread, and you confirmed).
like i said no "rocket science code", but if you follow the good practices (even with simple code) it will save your neck later if you keep adding code
@DJ: One little detail, the camera's close event is being called twice, i double checked the code... not a big deal, i noticed due the output debug.