loading
 
how to connect roborealm to c++?
Jafni from Malaysia  [29 posts]
15 year
How can I connect wireless to C++ using Roborealm. I'm goona display the view from the wireless camera on the GUI of C++. I hope you can guide or give way to do it. For now I can detect certain pattern for my project and now i need to display on C++.
Homer M. Manalo from Philippines  [3 posts] 15 year
maybe this can help:
http://www.roborealm.com/help/API.php
Jafni from Malaysia  [29 posts] 15 year
I already open this webpage but I'm not really understand how to connect it. I want to know if I had to put some command...im beginer in this field, somebody please give me some advice... I don't know how to use this API...
Jafni from Malaysia  [29 posts] 15 year
For now on I can connect Roborealm with C++ using Sample_API_App. But I don't know how to convert from capture image to video display. I already try certain command but it didn't work. I think I should make something to this area:

if (hBitmap)    DeleteObject(hBitmap);

    hBitmap = rr.getBitmap("processed", image, &width, &height,      320*240*3);

    imageCtl.SetBitmap(hBitmap);

    rr.disconnect();

    free(image);

I hope that anyone can help me.... I also beginner to C++..  
Anonymous 15 year
Jafni,

You should just try running the Sample_API_App which already does what you ask by displaying the image on its GUI interface. Perhaps you can start from the API.zip file again and try getting the sample to run as is. Then once that is running correctly have a look what is different from your project to that project to see where you are going wrong.

STeven.
Anonymous 15 year
Now I want to ask you how I want to get path name hBitmap using C++?? For your information until now I already can conect it to C++ and I put timer to make it always show a picture.. But how I to make this robot stop when it detect's an image?? I think I should put path name but I dont know how? I want to say a million thank's to you because you had help me so much until I reach this part.. Thank you for your help..
Anonymous 15 year
Are you referring to the path name created by the Shape matching module? If so have a look at the get_variable API call which can be used in C++ to get the path name of the matching pattern.

STeven.
Jafni from Malaysia  [29 posts] 15 year
Hello.. I want to ask you how to get file path name hBitmap using C++?? Actually I want to build the robot for my project. I'm using C++ to make it detect 4 pattern and it will stop for a second when it detect any one of that pattern. I had make a code until it can display in GUI but I don't know  how to make it detect an image and it will display a character like "Triangle" and this robot will stop for a second. Can you help me? I also include my code...

void CSample_API_AppDlg::OnGetImage()
{
    SetTimer(ID_CLOCK_TIMER,100,NULL);
}
void CSample_API_AppDlg::OnTimer(UINT nIDEvent)
{
    // TODO: Add your message handler code here and/or call default
    
    switch(nIDEvent)
    {
    case ID_CLOCK_TIMER:
    
    
    int width, height;
    unsigned char *image = (unsigned char *)malloc(320*240*3);

    RR_API rr;

    // open up RoboRealm if it is not already running. Note you may need to change
    // the path on this.
    rr.open("c:\\www\RoboRealm\\bin\\RoboRealm.exe", 6060);

    if (!rr.connect("localhost"))
    {
        printf("RoboRealm does not appear to be running.\nPlease run RoboRealm and try again.");
        exit(0);
    }

    if (hBitmap)    DeleteObject(hBitmap);

    hBitmap = rr.getBitmap("processed", image, &width, &height, 320*240*3);

    imageCtl.SetBitmap(hBitmap);
    
    
    
    rr.disconnect();

    free(image);
    break;
    }
    CDialog::OnTimer(nIDEvent);
}

Your kindness are really appreciated...
Anonymous 15 year
Jafni,

I'm not sure I understand your request? What do you mean by "get file path name hBitmap using C++"?

Do you want to know the file that was loaded in the hBitmap? Are you trying to load in a bmp file into memory? Are you trying to save a hBitmap??

STeven.
Jafni from Malaysia  [29 posts] 15 year
For the time been, i have success to show live video at GUI through Roborealm and detect several unique pattern that i have already save that pattern in the roborealm. My problem is how can i get the name of the pattern that i already save in the roborealm so that i can display it in GUI since i have several pattern so i could differentiate it by its name.

Example: I save a triangle (with the name of triangle) in roborealm and it can detect the triangle and show it on the GUI. But how can i get the name of the "triangle" and show it on the GUI. Hope you could give me some of the source code.

Please Help me. Thanks
Anonymous 15 year
I assume that this was answered in your other thread?

http://www.roborealm.com/forum/index.php?thread_id=3256#

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index