Пример #1
0
int main(int argc, char *argv[])
{
    (void)argc;
    (void)argv;

    struct aa_rx_win * win =
        aa_rx_win_default_create ( "UR10 Demo", SCREEN_WIDTH, SCREEN_HEIGHT );
    printf("OpenGL Version: %s\n", glGetString(GL_VERSION));

    // Initialize scene graph
    struct aa_rx_sg *scenegraph = aa_rx_dl_sg__ur(NULL);
    aa_rx_sg_init(scenegraph); /* initialize scene graph internal structures */
    aa_rx_win_set_sg(win, scenegraph); /* Set the scenegraph for the window */

    // start display
    aa_rx_win_start(win);

    // Cleanup
    aa_rx_win_join(win);
    aa_rx_sg_destroy(scenegraph);
    aa_rx_win_destroy(win);
    SDL_Quit();

    return 0;
}
Пример #2
0
int main(int argc, char *argv[])
{
    (void)argc;
    (void)argv;

    struct aa_rx_win * win =
        aa_rx_win_default_create ( "Sync Test", SCREEN_WIDTH, SCREEN_HEIGHT );

    struct aa_rx_sg *sg0 = aa_rx_dl_sg__scenegraph (NULL);

    aa_rx_sg_init(sg0); /* initialize scene graph internal structures */
    aa_rx_win_sg_gl_init(win, sg0); /* Initialize scene graph GL-rendering objects */
    aa_rx_win_set_sg(win, sg0); /* Set the scenegraph for the window */

    // start display
    aa_rx_win_start(win);

    int n_thread = 10;
    pthread_t thread[n_thread];
    for( size_t i = 0; i < n_thread; i ++ ) {
        pthread_create( thread + i, NULL, fun, win );
    }
    for( size_t i = 0; i < n_thread; i ++ ) {
        pthread_join(thread[i], NULL );
    }


    // Cleanup
    aa_rx_win_join(win);
    aa_rx_win_destroy(win);
    SDL_Quit();

    return 0;
}
Пример #3
0
int main(int argc, char *argv[])
{
    (void)argc; (void)argv;

    // Initialize scene graph
    struct aa_rx_sg *scenegraph = aa_rx_dl_sg__scenegraph(NULL);

    // setup window
    struct aa_rx_win * win = baxter_demo_setup_window(scenegraph);

    // start display
    aa_rx_win_start(win);

    // Cleanup
    aa_rx_win_join(win);
    aa_rx_sg_destroy(scenegraph);
    aa_rx_win_destroy(win);
    SDL_Quit();

    return 0;
}
Пример #4
0
int main(int argc, char *argv[])
{
    int visual = 1;
    int collision = 0;

    /* Parse Options */
    {
        int c;
        opterr = 0;

        while( (c = getopt( argc, argv, "?c")) != -1 ) {
            switch(c) {
            case 'c':
                visual = 0;
                collision = 1;
                break;
            case '?':
                puts("Usage: COMMAND [OPTIONS] \n"
                     "Viewer for Amino scene graphs"
                     "\n"
                     "Options:\n"
                     "  -c              view collision geometry\n"
                     "\n"
                     "\n"
                     "Report bugs to " PACKAGE_BUGREPORT "\n" );
                exit(EXIT_SUCCESS);
                break;
            }

        }
    }

    /* Initialize scene graph */
    struct aa_rx_sg *scenegraph = NAME( NULL);

    assert(scenegraph);
    aa_rx_sg_init(scenegraph); /* initialize scene graph internal structures */

    /* Center configurations */
    size_t m = aa_rx_sg_config_count(scenegraph);
    double q[m];
    for(size_t i = 0; i < m; i ++ ) {
        double min=0,max=0;
        aa_rx_sg_get_limit_pos(scenegraph,(aa_rx_config_id)i,&min,&max);
        q[i] = (max + min)/2;
    }

    /* setup window */
    struct aa_rx_win * win =
        aa_rx_win_default_create ( "Amino: AARX-View", SCREEN_WIDTH, SCREEN_HEIGHT );
    aa_rx_win_set_sg(win, scenegraph); /* Set the scenegraph for the window */
    aa_rx_win_set_config(win, m, q);

    struct aa_gl_globals *globals = aa_rx_win_gl_globals(win);
    aa_gl_globals_set_show_visual(globals, visual);
    aa_gl_globals_set_show_collision(globals, collision);

    /* start display */
    aa_rx_win_start(win);

    /* Cleanup */
    aa_rx_win_join(win);
    aa_rx_sg_destroy(scenegraph);
    aa_rx_win_destroy(win);
    SDL_Quit();

    return 0;
}