void initialize_octave() { char *argv[2]; argv[0] = "octave-ruby"; argv[1] = "-q"; octave_main(2,argv,1); bind_internal_variable("crash_dumps_octave_core", false); }
void COctaveInterface::run_octave_init() { char* name=strdup("octave"); char* opts=strdup("-q"); char* argv[2]={name, opts}; octave_main(2,argv,1); free(opts); free(name); }
octave_caller_t::octave_caller_t() { wordexp_t p; std::string test_path = "$PRACSYS_PATH/prx_utilities/prx/utilities/octave_interface/functions/"; wordexp(test_path.c_str(), &p, 0); std::string dir(p.we_wordv[0]); f_arg(0) = dir; const char * argvv[] = {"", "-q"}; octave_main(2, (char**)argvv, true); feval("cd", f_arg); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); // crear la aplicacion de Qt MainWindow w; // Crear un objeto MainWidnow w.show(); // mostrar el objeto // Argumentos para octave argv[0] = "GUI_NS"; argv[1] = "-q"; // Iniciar en modo silencioso (no muestra informacion de la version o la licencia argc = 2; // Numero de argumentos setlocale(LC_ALL, "en_US.UTF-8"); // Indicar a octave que se trabajara en English, o si no, no funciona octave_main (argc, argv, true); // Llamar al main de octave feval("inicializar"); return a.exec(); // Ejecutar la aplicacion Qt }
extern "C" const char * stage16_5_blep (const char *foo) { string_vector argv(2); argv(0) = "embedded"; argv(1) = "-q"; octave_main(2, argv.c_str_vec(), 1); octave_exit = much_improved_octave_exit_func; int st=0; eval_string("source(\"stage17.m\")", true, st); octave_value_list args(1); args(octave_idx_type(0)) = octave_value(foo); octave_value_list out = feval("blep", args, 1); std::string orv = out(0).string_value(); const char *rv = strdup(orv.c_str()); clean_up_and_exit(0); return rv; }
void octave_init(int argc, char *argv[]) { octave_main(argc,argv,1); }
int main(int argc, char **argv) { /** * The ros::init() function needs to see argc and argv so that it can perform * any ROS arguments and name remapping that were provided at the command line. For programmatic * remappings you can use a different version of init() which takes remappings * directly, but for most command-line programs, passing argc and argv is the easiest * way to do it. The third argument to init() is the name of the node. * * You must call one of the versions of ros::init() before using any other * part of the ROS system. */ ros::init(argc, argv, "talker"); Hmm hmm(0,0); // hmm.init(); const char * argvv [] = {"" /* name of program, not relevant */, "--silent"}; octave_main (2, (char **) argvv, true /* embedded */); // ros::init(argc, argv, "listener"); /** * NodeHandle is the main access point to communications with the ROS system. * The first NodeHandle constructed will fully initialize this node, and the last * NodeHandle destructed will close down the node. */ ros::NodeHandle n; /** * The subscribe() call is how you tell ROS that you want to receive messages * on a given topic. This invokes a call to the ROS * master node, which keeps a registry of who is publishing and who * is subscribing. Messages are passed to a callback function, here * called chatterCallback. subscribe() returns a Subscriber object that you * must hold on to until you want to unsubscribe. When all copies of the Subscriber * object go out of scope, this callback will automatically be unsubscribed from * this topic. * * The second parameter to the subscribe() function is the size of the message * queue. If messages are arriving faster than they are being processed, this * is the number of messages that will be buffered up before beginning to throw * away the oldest ones. */ // %Tag(SUBSCRIBER)% //ros::Subscriber sub = n.subscribe("Langles", 4, hmm.chatterCallback); ros::Subscriber sub = n.subscribe("Langles2", 40, &Hmm::chatterCallback, &hmm); // %EndTag(SUBSCRIBER)% /** * ros::spin() will enter a loop, pumping callbacks. With this version, all * callbacks will be called from within this thread (the main one). ros::spin() * will exit when Ctrl-C is pressed, or the node is shutdown by the master. */ // %Tag(SPIN)% ros::spin(); // %EndTag(SPIN)% return 0; }