00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WBC_TUTORIAL_SIMULATOR_HPP
00023 #define WBC_TUTORIAL_SIMULATOR_HPP
00024
00025
00026
00027
00028
00029 #ifndef TUTROB_XML_PATH_STR
00030 #define TUTROB_XML_PATH_STR "tutrob.xml"
00031 #endif // TUTROB_XML_PATH_STR
00032
00033 #include <jspace/Model.hpp>
00034
00040 struct tutsim {
00041
00054 static void set_robot_filename(char const * robot_filename);
00055
00060 static void set_rates(double gfx_rate_hz,
00061 double servo_rate_hz,
00062 double sim_rate_hz);
00063
00072 static void set_window_params(int width, int height, char const * title);
00073
00080 static void draw_robot(jspace::Vector const & jpos, int width,
00081 unsigned char red, unsigned char green, unsigned char blue,
00082 double x0, double y0, double scale);
00083
00088 static void draw_delta_jpos(jspace::Vector const & jpos, int width,
00089 unsigned char red, unsigned char green, unsigned char blue,
00090 double x0, double y0, double scale);
00091
00105 static void set_draw_cb(void (*draw_cb)(double x0, double y0, double scale));
00106
00119 static int run(bool (*servo_cb)(size_t toggle_count,
00120 double wall_time_ms,
00121 double sim_time_ms,
00122 jspace::State & state,
00123 jspace::Vector & command));
00124
00125 };
00126
00127 #endif // WBC_TUTORIAL_SIMULATOR_HPP