tfshm
機能
共有メモリ
使い方
tfshm *tfshm_open( char *name );
名前を指定して共有メモリを読み出し用に開く
tfshm *tfshm_create( char *name );
名前を指定して共有メモリを書き込み用に作成
size_t tfshm_read( tfshm *port, void *data, size_t size );
共有メモリからsizeバイト読み出し
size_t tfshm_write( tfshm *port, void *data, size_t size );
共有メモリにsizeバイト書き出し
void tfshm_close( tfshm *port );
共有メモリを閉じる
プログラミング・コンパイル
#include <tfshm.h>
-ltfshm
tb-cstrans
機能
テーブルを用いた高速な極座標->直交座標変換と、回転
構造体
CSTrans
テーブルを保持する
vector
最適化に適したベクトルデータ
vector.x,vector.y
vector.r,vector.theta
使い方
CSTrans *cstrans_init( int resolution );
テーブルの初期化。角度の分解能をresolutionで指定。Top-URGなら1024
void cstrans_free( CSTrans *table );
テーブルの解放
void cstrans_polar2rect( CSTrans *cst, vector *src, vector *dest, int len );
極座標から直交座標の変換。1080点をCore 2 duo 1.8GHz で15usくらい。
void cstrans_rotate( CSTrans *cst, vector *src, vector *dest, int len, int step );
直交座標での回転(角度の分解能のステップ数単位)1080点をCore 2 duo 1.8GHz で10usくらい。
プログラミング・コンパイル
#include <tb-cstrans.h>
-ltb-cstrans