Utilities
[libstage API reference]
Modules | |
Floating point comparisons | |
Defines | |
#define | BILLION 1e9 |
#define | DTOR(d) ((d) * M_PI / 180.0) |
#define | FALSE 0 |
#define | M_PI 3.14159265358979323846 |
#define | MILLION 1e6 |
#define | NORMALIZE(z) atan2(sin(z), cos(z)) |
#define | RTOD(r) ((r) * 180.0 / M_PI) |
#define | TRUE 1 |
#define | TWOPI (2.0*M_PI) |
Functions | |
stg_color_t | stg_lookup_color (const char *name) |
void | stg_pose_sum (stg_pose_t *result, stg_pose_t *p1, stg_pose_t *p2) |
void | stg_print_err (const char *err) |
void | stg_print_geom (stg_geom_t *geom) |
void | stg_print_gripper_config (stg_gripper_config_t *slc) |
void | stg_print_laser_config (stg_laser_config_t *slc) |
void | stg_print_pose (stg_pose_t *pose) |
void | stg_print_velocity (stg_velocity_t *vel) |
Detailed Description
Various useful macros and functions that don't belong anywhere else.Define Documentation
#define BILLION 1e9 |
Referenced by stg_lines_normalize(), stg_polygons_normalize(), and stg_rotrects_normalize().
#define DTOR | ( | d | ) | ((d) * M_PI / 180.0) |
#define FALSE 0 |
#define M_PI 3.14159265358979323846 |
Referenced by draw(), gripper_break_beam(), gui_window_create(), itl_first_matching(), itl_wall_distance(), model_event_callback(), model_render_velocity(), position_update(), ranger_init(), stg_matrix_lines(), stg_rtk_fig_arrow(), stg_rtk_fig_arrow_fancy(), stg_rtk_fig_ellipse(), stg_rtk_fig_image_calc(), stg_rtk_fig_line_ex(), stg_rtk_fig_text_bubble(), and wifi_render_cfg().
#define MILLION 1e6 |
Referenced by stg_world_dimensions().
#define NORMALIZE | ( | z | ) | atan2(sin(z), cos(z)) |
Normalize angle to domain -pi, pi.
Referenced by audio_update(), itl_create(), model_fiducial_check_neighbor(), position_load(), position_update(), InterfaceSimulation::ProcessMessage(), and stg_model_get_global_pose().
#define RTOD | ( | r | ) | ((r) * 180.0 / M_PI) |
Convert radians to degrees.
Referenced by audio_update(), gc_model_group_create(), gc_model_move(), and InterfaceLaser::ProcessMessage().
#define TRUE 1 |
#define TWOPI (2.0*M_PI) |
Function Documentation
stg_color_t stg_lookup_color | ( | const char * | name | ) |
Look up the color in the X11 database. (i.e. transform color name to color value). If the color is not found in the database, a bright red color (0xF00) will be returned instead.
References PRINT_DEBUG, PRINT_DEBUG1, PRINT_ERR1, and TRUE.
Referenced by audio_render_cfg(), audio_render_data(), blobfinder_init(), blobfinder_load(), blobfinder_render_cfg(), fiducial_render_data(), gripper_init(), gripper_render_cfg(), gui_action_raytrace(), gui_model_grid(), gui_window_create(), laser_init(), ranger_init(), ranger_render_data(), speech_render_data(), stg_model_load(), and wifi_init().
void stg_pose_sum | ( | stg_pose_t * | result, | |
stg_pose_t * | p1, | |||
stg_pose_t * | p2 | |||
) |
calculate the sum of [p1] and [p2], in [p1]'s coordinate system, and copy the result into result.
References stg_pose_t::a, stg_pose_t::x, and stg_pose_t::y.
Referenced by stg_model_local_to_global(), and stg_model_test_collision().
void stg_print_err | ( | const char * | err | ) |
void stg_print_geom | ( | stg_geom_t * | geom | ) |
Print human-readable geometry on stdout
References stg_pose_t::a, stg_geom_t::pose, stg_geom_t::size, stg_size_t::x, stg_pose_t::x, stg_size_t::y, and stg_pose_t::y.
void stg_print_gripper_config | ( | stg_gripper_config_t * | slc | ) |
Print human-readable version of the gripper config struct
References stg_gripper_config_t::lift, stg_gripper_config_t::lift_position, stg_gripper_config_t::paddle_position, stg_gripper_config_t::paddles, stg_gripper_config_t::paddles_stalled, STG_GRIPPER_LIFT_DOWN, STG_GRIPPER_LIFT_DOWNING, STG_GRIPPER_LIFT_UP, STG_GRIPPER_LIFT_UPPING, STG_GRIPPER_PADDLE_CLOSED, STG_GRIPPER_PADDLE_CLOSING, STG_GRIPPER_PADDLE_OPEN, and STG_GRIPPER_PADDLE_OPENING.
void stg_print_laser_config | ( | stg_laser_config_t * | slc | ) |
Print human-readable version of the laser config struct
void stg_print_pose | ( | stg_pose_t * | pose | ) |
Print human-readable pose on stdout
References stg_pose_t::a, stg_pose_t::x, and stg_pose_t::y.
void stg_print_velocity | ( | stg_velocity_t * | vel | ) |
Print human-readable velocity on stdout
References stg_pose_t::a, stg_pose_t::x, and stg_pose_t::y.
Generated on Wed Jun 3 23:12:29 2009 for Stage by
