Stg::StgModel Class Reference
#include <stage.hh>
Inherits Stg::StgAncestor.
Inherited by Stg::StgModelBlinkenlight, Stg::StgModelBlobfinder, Stg::StgModelFiducial, Stg::StgModelLaser, Stg::StgModelPosition, and Stg::StgModelRanger.
Constructor & Destructor Documentation
References AddBlockRect(), Stg::StgAncestor::AddChild(), Stg::StgWorld::AddModel(), blinkenlights, blob_return, blocks, body_dirty, boundary, callbacks, color, d_list, data_dirty, data_fresh, debug, disabled, fiducial_key, fiducial_return, flag_list, geom, Stg::StgAncestor::GetNumChildrenOfType(), global_pose, gpose_dirty, gripper_return, gui_grid, gui_mask, gui_nose, gui_outline, initfunc, interval, laser_return, last_update, map_resolution, obstacle_return, on_velocity_list, Stg::stg_geom_t::pose, pose, PRINT_DEBUG2, PRINT_DEBUG4, ranger_return, say_string, Stg::stg_geom_t::size, stall, STG_DEFAULT_MOD_BLOBRETURN, STG_DEFAULT_MOD_BOUNDARY, STG_DEFAULT_MOD_COLOR, STG_DEFAULT_MOD_GEOM_SIZEX, STG_DEFAULT_MOD_GRID, STG_DEFAULT_MOD_GRIPPERRETURN, STG_DEFAULT_MOD_LASERRETURN, STG_DEFAULT_MOD_MAP_RESOLUTION, STG_DEFAULT_MOD_MASK, STG_DEFAULT_MOD_NOSE, STG_DEFAULT_MOD_OBSTACLERETURN, STG_DEFAULT_MOD_OUTLINE, STG_DEFAULT_MOD_RANGERRETURN, subs, Stg::StgAncestor::token, Stg::StgAncestor::Token(), Stg::TOKEN_MAX, trail, velocity, Stg::stg_size_t::x, Stg::stg_size_t::y, and Stg::stg_size_t::z.
Referenced by Create().
StgModel::~StgModel | ( | void | ) | [virtual] |
References callbacks, Stg::StgAncestor::children, parent, Stg::StgWorld::RemoveModel(), and world.
Member Function Documentation
void Stg::StgModel::AddBlinkenlight | ( | stg_blinkenlight_t * | b | ) | [inline] |
References blinkenlights.
void StgModel::AddBlock | ( | stg_point_t * | pts, | |
size_t | pt_count, | |||
stg_meters_t | zmin, | |||
stg_meters_t | zmax, | |||
stg_color_t | color, | |||
bool | inherit_color | |||
) |
void StgModel::AddBlockRect | ( | double | x, | |
double | y, | |||
double | width, | |||
double | height | |||
) |
References AddBlock(), Stg::stg_point_t::x, and Stg::stg_point_t::y.
Referenced by Load(), and StgModel().
void StgModel::AddCallback | ( | void * | address, | |
stg_model_callback_t | cb, | |||
void * | user | |||
) |
References callbacks, Stg::cb_create(), and key_gen().
Referenced by AddLoadCallback(), AddSaveCallback(), AddShutdownCallback(), AddStartupCallback(), and AddUpdateCallback().
void Stg::StgModel::AddLoadCallback | ( | stg_model_callback_t | cb, | |
void * | user | |||
) | [inline] |
References AddCallback(), and load.
void Stg::StgModel::AddPropertyToggles | ( | void * | member, | |
stg_model_callback_t | callback_on, | |||
void * | arg_on, | |||
stg_model_callback_t | callback_off, | |||
void * | arg_off, | |||
char * | name, | |||
char * | label, | |||
gboolean | enabled | |||
) |
void Stg::StgModel::AddSaveCallback | ( | stg_model_callback_t | cb, | |
void * | user | |||
) | [inline] |
References AddCallback(), and save.
void Stg::StgModel::AddShutdownCallback | ( | stg_model_callback_t | cb, | |
void * | user | |||
) | [inline] |
References AddCallback(), and shutdown.
void Stg::StgModel::AddStartupCallback | ( | stg_model_callback_t | cb, | |
void * | user | |||
) | [inline] |
References AddCallback(), and startup.
void StgModel::AddToPose | ( | double | dx, | |
double | dy, | |||
double | dz, | |||
double | da | |||
) |
add values to a model's pose in its parent's coordinate system
References Stg::stg_pose_t::a, GetPose(), pose, SetPose(), Stg::stg_pose_t::x, Stg::stg_pose_t::y, and Stg::stg_pose_t::z.
void StgModel::AddToPose | ( | stg_pose_t | pose | ) |
add values to a model's pose in its parent's coordinate system
References Stg::stg_pose_t::a, Stg::stg_pose_t::x, Stg::stg_pose_t::y, and Stg::stg_pose_t::z.
Referenced by Stg::StgCanvas::handle().
void Stg::StgModel::AddUpdateCallback | ( | stg_model_callback_t | cb, | |
void * | user | |||
) | [inline] |
References AddCallback(), and update.
void StgModel::CallCallbacks | ( | void * | address | ) |
References Stg::stg_cb_t::arg, Stg::stg_cb_t::callback, callbacks, key_gen(), and RemoveCallback().
Referenced by Load(), Save(), SetBlobReturn(), SetBoundary(), SetColor(), SetFiducialKey(), SetFiducialReturn(), SetGeom(), SetGripperReturn(), SetGuiGrid(), SetGuiMask(), SetGuiNose(), SetGuiOutline(), SetLaserReturn(), SetMapResolution(), SetMass(), SetObstacleReturn(), SetParent(), SetPose(), SetRangerReturn(), SetStall(), SetVelocity(), SetWatts(), Shutdown(), Startup(), and Update().
void Stg::StgModel::ClearBlinkenlights | ( | ) | [inline] |
References blinkenlights.
void StgModel::ClearBlocks | ( | void | ) |
remove all blocks from this model, freeing their memory
References blocks, body_dirty, and Stg::stg_block_list_destroy().
Referenced by Load(), Stg::StgModelBlobfinder::StgModelBlobfinder(), Stg::StgModelFiducial::StgModelFiducial(), and Stg::StgModelRanger::StgModelRanger().
static StgModel* Stg::StgModel::Create | ( | StgWorld * | world, | |
StgModel * | parent, | |||
stg_id_t | id, | |||
char * | typestr | |||
) | [inline, static] |
Reimplemented in Stg::StgModelBlobfinder, Stg::StgModelLaser, Stg::StgModelFiducial, Stg::StgModelRanger, Stg::StgModelBlinkenlight, and Stg::StgModelPosition.
References StgModel().
bool Stg::StgModel::DataIsFresh | ( | ) | [inline] |
References data_fresh.
void StgModel::DataVisualize | ( | void | ) | [protected, virtual] |
Reimplemented in Stg::StgModelBlobfinder, Stg::StgModelLaser, and Stg::StgModelRanger.
Referenced by Draw().
void Stg::StgModel::Disable | ( | ) | [inline] |
void StgModel::Draw | ( | uint32_t | flags | ) | [protected, virtual] |
Reimplemented in Stg::StgModelBlinkenlight.
References blinkenlights, Stg::StgAncestor::children, DataVisualize(), DrawBlinkenlights(), DrawFlagList(), DrawGrid(), flag_list, geom, Stg::gl_coord_shift(), Stg::gl_draw_string(), Stg::gl_pose_shift(), gui_grid, Stg::stg_geom_t::pose, pose, Stg::stg_geom_t::size, stall, Stg::STG_SHOW_DATA, Stg::STG_SHOW_GRID, and Stg::stg_size_t::z.
Referenced by Stg::StgModelBlinkenlight::Draw(), and DrawTrailBlocks().
void StgModel::DrawBlinkenlights | ( | ) | [protected] |
void StgModel::DrawBlocks | ( | gpointer | dummykey, | |
StgModel * | mod, | |||
void * | arg | |||
) | [static, protected] |
References DrawBlocks().
void StgModel::DrawBlocks | ( | ) | [protected, virtual] |
void StgModel::DrawFlagList | ( | void | ) |
References Stg::stg_pose_t::a, Stg::StgFlag::color, flag_list, GetGlobalPose(), PopColor(), PushColor(), Stg::rtod(), Stg::StgFlag::size, Stg::stg_color_pack(), and Stg::stg_color_unpack().
Referenced by Draw().
void StgModel::DrawGrid | ( | void | ) | [protected] |
void StgModel::DrawPicker | ( | void | ) | [protected, virtual] |
References blocks, Stg::StgAncestor::children, geom, Stg::gl_coord_shift(), Stg::gl_pose_shift(), LISTMETHOD, Stg::stg_geom_t::pose, pose, Stg::stg_geom_t::size, and Stg::stg_size_t::z.
Referenced by Stg::StgCanvas::Select().
void StgModel::DrawSelected | ( | void | ) | [protected, virtual] |
References Stg::stg_pose_t::a, geom, GetGlobalPose(), Stg::gl_draw_string(), Stg::gl_pose_shift(), PopColor(), Stg::stg_geom_t::pose, pose, PushColor(), Stg::rtod(), Stg::stg_geom_t::size, Stg::StgAncestor::token, Stg::stg_size_t::x, Stg::stg_pose_t::x, Stg::stg_size_t::y, Stg::stg_pose_t::y, and Stg::stg_pose_t::z.
void StgModel::DrawTrailArrows | ( | ) | [protected] |
void StgModel::DrawTrailBlocks | ( | ) | [protected] |
void StgModel::DrawTrailFootprint | ( | ) | [protected] |
void Stg::StgModel::Enable | ( | ) | [inline] |
int Stg::StgModel::FiducialKey | ( | ) | [inline] |
References fiducial_key.
int Stg::StgModel::FiducialReturn | ( | ) | [inline] |
References fiducial_return.
stg_color_t Stg::StgModel::GetColor | ( | ) | [inline] |
int Stg::StgModel::GetFlagCount | ( | ) | [inline] |
References flag_list.
stg_geom_t Stg::StgModel::GetGeom | ( | ) | [inline] |
Get a model's geometry - it's size and local pose (offset from origin in local coords)
References geom.
Referenced by Load(), InterfacePosition::ProcessMessage(), and InterfaceLaser::ProcessMessage().
stg_pose_t StgModel::GetGlobalPose | ( | ) | [virtual] |
get the pose of a model in the global CS
Reimplemented from Stg::StgAncestor.
References geom, GetGlobalPose(), global_pose, gpose_dirty, parent, pose, Stg::stg_geom_t::size, Stg::stg_pose_sum(), Stg::stg_size_t::z, and Stg::stg_pose_t::z.
Referenced by Stg::StgModelBlobfinder::DataVisualize(), Stg::StgCanvas::draw(), DrawFlagList(), DrawSelected(), GetGlobalPose(), GetGlobalVelocity(), GlobalToLocal(), Stg::StgModelPosition::Load(), LocalToGlobal(), PrintWithPose(), InterfaceGraphics3d::Publish(), SetGlobalVelocity(), Stg::StgModelPosition::SetOdom(), Stg::StgModelPosition::Update(), and Stg::StgModelLaser::Update().
stg_velocity_t StgModel::GetGlobalVelocity | ( | ) |
get the velocity of a model in the global CS
References Stg::stg_pose_t::a, GetGlobalPose(), velocity, Stg::stg_pose_t::x, and Stg::stg_pose_t::y.
stg_laser_return_t Stg::StgModel::GetLaserReturn | ( | ) | [inline] |
StgModel * StgModel::GetModel | ( | const char * | name | ) |
References Stg::StgWorld::GetModel(), PRINT_WARN1, Stg::StgAncestor::token, Stg::TOKEN_MAX, and world.
Referenced by Init().
stg_pose_t Stg::StgModel::GetPose | ( | ) | [inline] |
Get the pose of a model in its parent's coordinate system
References pose.
Referenced by AddToPose(), Load(), InterfaceSimulation::ProcessMessage(), and InterfaceLaser::ProcessMessage().
void * StgModel::GetProperty | ( | char * | key | ) |
named-property interface
References color, fiducial_return, gripper_return, laser_return, mass, MATCH, obstacle_return, PRINT_WARN1, props, ranger_return, Stg::STG_MP_COLOR, Stg::STG_MP_FIDUCIAL_RETURN, Stg::STG_MP_GRIPPER_RETURN, Stg::STG_MP_LASER_RETURN, Stg::STG_MP_MASS, Stg::STG_MP_OBSTACLE_RETURN, Stg::STG_MP_PREFIX, Stg::STG_MP_RANGER_RETURN, Stg::STG_MP_WATTS, and watts.
int Stg::StgModel::GetRangerReturn | ( | ) | [inline] |
References ranger_return.
StgModel * StgModel::GetUnsubscribedModelOfType | ( | char * | modelstr | ) |
returns the first descendent of this model that is unsubscribed and has the type indicated by the string
References Stg::StgAncestor::children, GetUnsubscribedModelOfType(), subs, and typestr.
Referenced by GetUnsubscribedModelOfType(), and StgDriver::LocateModel().
stg_velocity_t Stg::StgModel::GetVelocity | ( | ) | [inline] |
Get a model's velocity (in its local reference frame)
References velocity.
Referenced by Load(), and InterfacePosition::Publish().
StgWorld* Stg::StgModel::GetWorld | ( | ) | [inline] |
void StgModel::GlobalToLocal | ( | stg_pose_t * | pose | ) |
Convert a pose in the world coordinate system into a model's local coordinate system. Overwrites [pose] with the new coordinate.
References Stg::stg_pose_t::a, GetGlobalPose(), Stg::stg_pose_t::x, and Stg::stg_pose_t::y.
Referenced by SetGlobalPose().
void StgModel::GPoseDirtyTree | ( | void | ) | [protected] |
Causes this model and its children to recompute their global position instead of using a cached pose in StgModel::GetGlobalPose()..
References Stg::StgAncestor::children, and gpose_dirty.
Referenced by SetPose().
int Stg::StgModel::GuiMask | ( | ) | [inline] |
stg_id_t Stg::StgModel::Id | ( | ) | [inline] |
void StgModel::Init | ( | ) |
Should be called after all models are loaded, to do any last-minute setup
References initfunc, and Subscribe().
Referenced by init_models().
bool StgModel::IsDescendent | ( | StgModel * | testmod | ) |
References Stg::StgAncestor::children, and IsDescendent().
Referenced by IsDescendent(), and IsRelated().
bool StgModel::IsRelated | ( | StgModel * | mod2 | ) |
References IsDescendent(), and Parent().
void StgModel::Load | ( | void | ) | [virtual] |
configure a model by reading from the current world file
Reimplemented in Stg::StgModelBlobfinder, Stg::StgModelLaser, Stg::StgModelFiducial, Stg::StgModelRanger, Stg::StgModelBlinkenlight, and Stg::StgModelPosition.
References Stg::stg_pose_t::a, AddBlock(), AddBlockRect(), Stg::StgWorld::AddModelName(), blocks, body_dirty, boundary, CallCallbacks(), ClearBlocks(), color, debug, Stg::Worldfile::filename, geom, GetGeom(), GetPose(), GetVelocity(), laser_return, load, LoadControllerModule(), Map(), Stg::stg_rotrect_t::pose, pose, Stg::stg_geom_t::pose, PRINT_DEBUG1, PRINT_ERR1, PRINT_WARN2, Stg::Worldfile::PropertyExists(), Stg::Worldfile::ReadFloat(), Stg::Worldfile::ReadInt(), Stg::Worldfile::ReadString(), Stg::Worldfile::ReadTupleAngle(), Stg::Worldfile::ReadTupleFloat(), Stg::Worldfile::ReadTupleLength(), Stg::StgBlock::ScaleList(), SetBlobReturn(), SetBoundary(), SetColor(), SetFiducialKey(), SetFiducialReturn(), SetGeom(), SetGripperReturn(), SetGuiGrid(), SetGuiMask(), SetGuiNose(), SetGuiOutline(), SetLaserReturn(), SetMapResolution(), SetMass(), SetObstacleReturn(), SetPose(), SetRangerReturn(), SetVelocity(), Stg::stg_rotrect_t::size, Stg::stg_geom_t::size, Stg::StgWorld::StartUpdatingModel(), Stg::stg_color_pack(), Stg::stg_lookup_color(), Stg::stg_points_create(), Stg::stg_points_destroy(), Stg::stg_rotrects_from_image_file(), Stg::StgAncestor::token, UnMap(), Stg::StgWorld::wf, world, Stg::stg_point_t::x, Stg::stg_size_t::x, Stg::stg_pose_t::x, Stg::stg_point_t::y, Stg::stg_size_t::y, Stg::stg_pose_t::y, Stg::stg_size_t::z, and Stg::stg_pose_t::z.
Referenced by Stg::StgWorld::Load(), Stg::StgModelRanger::Load(), Stg::StgModelPosition::Load(), Stg::StgModelLaser::Load(), Stg::StgModelFiducial::Load(), Stg::StgModelBlobfinder::Load(), and Stg::StgModelBlinkenlight::Load().
void StgModel::LoadControllerModule | ( | char * | lib | ) |
stg_point3_t StgModel::LocalToGlobal | ( | stg_point3_t | local | ) |
Return the 3d point in world coordinates of a 3d point specified in the model's local coordinate system
References Stg::stg_pose_t::a, LocalToGlobal(), pose, Stg::stg_point3_t::x, Stg::stg_pose_t::x, Stg::stg_point3_t::y, Stg::stg_pose_t::y, Stg::stg_point3_t::z, and Stg::stg_pose_t::z.
stg_pose_t StgModel::LocalToGlobal | ( | stg_pose_t | pose | ) |
Convert a pose in the model's local coordinate system into the world coordinate system. Overwrites [pose] with the new coordinate. Return the global pose (i.e. pose in world coordinates) of a pose specified in the model's local coordinate system
References geom, GetGlobalPose(), Stg::stg_geom_t::pose, and Stg::pose_sum().
Referenced by LocalToGlobal(), Stg::StgBlock::Map(), and Raytrace().
void StgModel::Map | ( | ) | [protected] |
References blocks, Stg::StgWorld::graphics, Stg::StgWorld::ppm, and world.
Referenced by Load(), MapWithChildren(), and SetGeom().
void StgModel::MapWithChildren | ( | ) | [protected] |
void StgModel::NeedRedraw | ( | void | ) |
bool Stg::StgModel::ObstacleReturn | ( | ) | [inline] |
References obstacle_return.
StgModel* Stg::StgModel::Parent | ( | ) | [inline] |
virtual void Stg::StgModel::PopColor | ( | ) | [inline, virtual] |
Implements Stg::StgAncestor.
References Stg::StgWorld::PopColor(), and world.
Referenced by Stg::StgModelRanger::DataVisualize(), Stg::StgModelLaser::DataVisualize(), Stg::StgModelBlobfinder::DataVisualize(), DrawBlinkenlights(), DrawFlagList(), DrawGrid(), DrawSelected(), DrawTrailArrows(), and DrawTrailFootprint().
void StgModel::Print | ( | char * | prefix | ) | [virtual] |
Reimplemented in Stg::StgModelLaser, and Stg::StgModelRanger.
References Stg::StgAncestor::token, Stg::StgAncestor::Token(), and world.
Referenced by Stg::StgModelRanger::Print(), and Stg::StgModelLaser::Print().
const char * StgModel::PrintWithPose | ( | ) | [virtual] |
virtual void Stg::StgModel::PushColor | ( | double | r, | |
double | g, | |||
double | b, | |||
double | a | |||
) | [inline, virtual] |
virtual void Stg::StgModel::PushColor | ( | stg_color_t | col | ) | [inline, virtual] |
Implements Stg::StgAncestor.
References Stg::StgWorld::PushColor(), and world.
Referenced by Stg::StgModelRanger::DataVisualize(), Stg::StgModelLaser::DataVisualize(), Stg::StgModelBlobfinder::DataVisualize(), DrawBlinkenlights(), DrawFlagList(), DrawGrid(), DrawSelected(), DrawTrailArrows(), and DrawTrailFootprint().
void StgModel::Raytrace | ( | stg_radians_t | angle, | |
stg_meters_t | range, | |||
stg_radians_t | fov, | |||
stg_block_match_func_t | func, | |||
const void * | arg, | |||
stg_raytrace_sample_t * | samples, | |||
uint32_t | sample_count | |||
) | [protected] |
References Stg::stg_pose_t::a, pose, and Raytrace().
void StgModel::Raytrace | ( | stg_pose_t | pose, | |
stg_meters_t | range, | |||
stg_radians_t | fov, | |||
stg_block_match_func_t | func, | |||
const void * | arg, | |||
stg_raytrace_sample_t * | samples, | |||
uint32_t | sample_count | |||
) | [protected] |
References LocalToGlobal(), Stg::StgWorld::Raytrace(), and world.
void StgModel::Raytrace | ( | stg_radians_t | angle, | |
stg_meters_t | range, | |||
stg_block_match_func_t | func, | |||
const void * | arg, | |||
stg_raytrace_sample_t * | sample | |||
) | [protected] |
References Stg::stg_pose_t::a, pose, and Raytrace().
void StgModel::Raytrace | ( | stg_pose_t | pose, | |
stg_meters_t | range, | |||
stg_block_match_func_t | func, | |||
const void * | arg, | |||
stg_raytrace_sample_t * | sample | |||
) | [protected] |
References LocalToGlobal(), Stg::StgWorld::Raytrace(), and world.
Referenced by Raytrace(), TestCollision(), Stg::StgModelRanger::Update(), Stg::StgModelLaser::Update(), and Stg::StgModelBlobfinder::Update().
int StgModel::RemoveCallback | ( | void * | member, | |
stg_model_callback_t | callback | |||
) |
References callbacks, and key_gen().
Referenced by CallCallbacks(), RemoveLoadCallback(), RemoveSaveCallback(), RemoveShutdownCallback(), RemoveStartupCallback(), and RemoveUpdateCallback().
void Stg::StgModel::RemoveLoadCallback | ( | stg_model_callback_t | cb | ) | [inline] |
References load, and RemoveCallback().
void Stg::StgModel::RemoveSaveCallback | ( | stg_model_callback_t | cb | ) | [inline] |
References RemoveCallback(), and save.
void Stg::StgModel::RemoveShutdownCallback | ( | stg_model_callback_t | cb | ) | [inline] |
References RemoveCallback(), and shutdown.
void Stg::StgModel::RemoveStartupCallback | ( | stg_model_callback_t | cb | ) | [inline] |
References RemoveCallback(), and startup.
void Stg::StgModel::RemoveUpdateCallback | ( | stg_model_callback_t | cb | ) | [inline] |
References RemoveCallback(), and update.
StgModel* Stg::StgModel::Root | ( | ) | [inline] |
void StgModel::Save | ( | void | ) | [virtual] |
save the state of the model to the current world file
References Stg::stg_pose_t::a, CallCallbacks(), pose, PRINT_DEBUG1, PRINT_DEBUG4, save, Stg::StgAncestor::token, Stg::StgWorld::wf, world, Stg::Worldfile::WriteTupleAngle(), Stg::Worldfile::WriteTupleLength(), Stg::stg_pose_t::x, Stg::stg_pose_t::y, and Stg::stg_pose_t::z.
void StgModel::Say | ( | char * | str | ) |
References say_string.
void StgModel::SetBlobReturn | ( | int | val | ) |
References blob_return, and CallCallbacks().
Referenced by Load(), and Stg::StgModelPosition::StgModelPosition().
void StgModel::SetBoundary | ( | int | val | ) |
void StgModel::SetColor | ( | stg_color_t | col | ) |
References body_dirty, CallCallbacks(), and color.
Referenced by Load(), SetProperty(), Stg::StgModelBlinkenlight::StgModelBlinkenlight(), Stg::StgModelLaser::StgModelLaser(), and Stg::StgModelRanger::StgModelRanger().
void StgModel::SetFiducialKey | ( | int | key | ) |
set a model's fiducial key: only fiducial finders with a matching key can detect this model as a fiducial.
References CallCallbacks(), and fiducial_key.
Referenced by Load().
void StgModel::SetFiducialReturn | ( | int | fid | ) |
set a model's geometry (size and center offsets)
References CallCallbacks(), and fiducial_return.
Referenced by Load(), and SetProperty().
void StgModel::SetGeom | ( | stg_geom_t | src | ) |
set a model's geometry (size and center offsets)
References blocks, body_dirty, CallCallbacks(), Map(), Stg::StgBlock::ScaleList(), Stg::stg_geom_t::size, and UnMap().
Referenced by Load(), Stg::StgModelBlinkenlight::StgModelBlinkenlight(), Stg::StgModelFiducial::StgModelFiducial(), Stg::StgModelLaser::StgModelLaser(), and Stg::StgModelRanger::StgModelRanger().
void StgModel::SetGlobalPose | ( | stg_pose_t | gpose | ) |
set the pose of model in global coordinates
References GlobalToLocal(), parent, and SetPose().
void StgModel::SetGlobalVelocity | ( | stg_velocity_t | gvel | ) |
References Stg::stg_pose_t::a, GetGlobalPose(), SetVelocity(), Stg::stg_pose_t::x, and Stg::stg_pose_t::y.
void StgModel::SetGripperReturn | ( | int | val | ) |
void StgModel::SetGuiGrid | ( | int | val | ) |
void StgModel::SetGuiMask | ( | int | val | ) |
void StgModel::SetGuiNose | ( | int | val | ) |
void StgModel::SetGuiOutline | ( | int | val | ) |
void StgModel::SetLaserReturn | ( | stg_laser_return_t | val | ) |
void StgModel::SetMapResolution | ( | stg_meters_t | res | ) |
void StgModel::SetMass | ( | stg_kg_t | mass | ) |
void StgModel::SetObstacleReturn | ( | int | val | ) |
int StgModel::SetParent | ( | StgModel * | newparent | ) |
Change a model's parent - experimental
References CallCallbacks(), Stg::StgAncestor::children, and parent.
void StgModel::SetPose | ( | stg_pose_t | pose | ) |
set a model's pose in its parent's coordinate system
References Stg::stg_pose_t::a, CallCallbacks(), GPoseDirtyTree(), MapWithChildren(), NeedRedraw(), Stg::normalize(), and UnMapWithChildren().
Referenced by AddToPose(), Load(), InterfaceSimulation::ProcessMessage(), SetGlobalPose(), and UpdatePose().
int StgModel::SetProperty | ( | char * | key, | |
void * | data | |||
) |
Set a named property of a Stage model.
Set a property of a Stage model.
This function can set both predefined and user-defined properties of a model. Predefined properties are intrinsic to every model, such as pose and color. Every supported predefined properties has its identifying string defined as a preprocessor macro in stage.h. Users should use the macro instead of a hard-coded string, so that the compiler can help you to avoid mis-naming properties.
User-defined properties allow the user to attach arbitrary data pointers to a model. User-defined property data is not copied, so the original pointer must remain valid. User-defined property names are simple strings. Names beginning with an underscore ('_') are reserved for internal libstage use: users should not use names beginning with underscore (at risk of causing very weird behaviour).
Any callbacks registered for the named property will be called.
Returns 0 on success, or a positive error code on failure.
CAUTION* The caller is responsible for making sure the pointer points to data of the correct type for the property, so use carefully. Check the docs or the equivalent stg_model_set_<property>() function definition to see the type of data required for each property.
References MATCH, PRINT_DEBUG1, PRINT_ERR1, props, SetColor(), SetFiducialReturn(), SetGripperReturn(), SetLaserReturn(), SetMass(), SetObstacleReturn(), SetRangerReturn(), SetWatts(), Stg::STG_MP_COLOR, Stg::STG_MP_FIDUCIAL_RETURN, Stg::STG_MP_GRIPPER_RETURN, Stg::STG_MP_LASER_RETURN, Stg::STG_MP_MASS, Stg::STG_MP_OBSTACLE_RETURN, Stg::STG_MP_PREFIX, Stg::STG_MP_RANGER_RETURN, and Stg::STG_MP_WATTS.
Referenced by InterfaceSimulation::ProcessMessage().
void StgModel::SetRangerReturn | ( | int | val | ) |
void StgModel::SetStall | ( | stg_bool_t | stall | ) |
void StgModel::SetVelocity | ( | stg_velocity_t | vel | ) |
set a model's velocity in its parent's coordinate system
References CallCallbacks(), on_velocity_list, velocity, velocity_is_nonzero(), Stg::StgWorld::velocity_list, and world.
Referenced by Load(), SetGlobalVelocity(), Stg::StgModelPosition::StgModelPosition(), and Stg::StgModelPosition::Update().
void StgModel::SetWatts | ( | stg_watts_t | watts | ) |
References CallCallbacks().
Referenced by SetProperty(), Stg::StgModelRanger::Shutdown(), Stg::StgModelPosition::Shutdown(), Stg::StgModelLaser::Shutdown(), Stg::StgModelBlobfinder::Shutdown(), Stg::StgModelRanger::Startup(), Stg::StgModelPosition::Startup(), Stg::StgModelLaser::Startup(), Stg::StgModelBlobfinder::Startup(), and Stg::StgModelPosition::StgModelPosition().
void StgModel::Shutdown | ( | void | ) | [protected, virtual] |
Reimplemented in Stg::StgModelBlobfinder, Stg::StgModelLaser, Stg::StgModelRanger, and Stg::StgModelPosition.
References CallCallbacks(), shutdown, Stg::StgWorld::StopUpdatingModel(), and world.
Referenced by Stg::StgModelRanger::Shutdown(), Stg::StgModelPosition::Shutdown(), Stg::StgModelLaser::Shutdown(), Stg::StgModelBlobfinder::Shutdown(), and Unsubscribe().
bool Stg::StgModel::Stall | ( | ) | [inline] |
void StgModel::Startup | ( | void | ) | [protected, virtual] |
Reimplemented in Stg::StgModelBlobfinder, Stg::StgModelLaser, Stg::StgModelRanger, and Stg::StgModelPosition.
References CallCallbacks(), initfunc, startup, Stg::StgWorld::StartUpdatingModel(), and world.
Referenced by Stg::StgModelRanger::Startup(), Stg::StgModelPosition::Startup(), Stg::StgModelLaser::Startup(), Stg::StgModelBlobfinder::Startup(), Stg::StgModelBlinkenlight::StgModelBlinkenlight(), and Subscribe().
void StgModel::Subscribe | ( | void | ) |
subscribe to a model's data
References Startup(), subs, Stg::StgWorld::total_subs, and world.
Referenced by Init(), and InterfaceModel::Subscribe().
StgModel * StgModel::TestCollision | ( | stg_pose_t * | pose, | |
double * | hitx, | |||
double * | hity | |||
) | [protected] |
References Stg::stg_pose_t::a, Stg::stg_raytrace_sample_t::block, blocks, MapWithChildren(), Stg::StgBlock::Model(), Stg::StgBlock::Points(), Stg::pose_sum(), Raytrace(), UnMapWithChildren(), Stg::stg_pose_t::x, Stg::stg_point_t::x, Stg::stg_pose_t::y, and Stg::stg_point_t::y.
Referenced by UpdatePose().
int StgModel::TreeToPtrArray | ( | GPtrArray * | array | ) | [protected] |
References Stg::StgAncestor::children.
const char* Stg::StgModel::TypeStr | ( | ) | [inline] |
References typestr.
void StgModel::UnMap | ( | ) | [protected] |
void StgModel::UnMapWithChildren | ( | ) | [protected] |
void StgModel::UnsetProperty | ( | char * | key | ) |
References PRINT_WARN1, props, and Stg::STG_MP_PREFIX.
void StgModel::Unsubscribe | ( | void | ) |
unsubscribe from a model's data
References Shutdown(), subs, Stg::StgAncestor::token, Stg::StgWorld::total_subs, and world.
Referenced by InterfaceModel::Unsubscribe().
void StgModel::Update | ( | void | ) | [protected, virtual] |
Reimplemented in Stg::StgModelBlobfinder, Stg::StgModelLaser, Stg::StgModelRanger, Stg::StgModelBlinkenlight, and Stg::StgModelPosition.
References CallCallbacks(), last_update, Stg::StgWorld::sim_time, update, and world.
Referenced by Stg::StgModelRanger::Update(), Stg::StgModelPosition::Update(), Stg::StgModelLaser::Update(), Stg::StgModelBlobfinder::Update(), Stg::StgModelBlinkenlight::Update(), and UpdateIfDue().
void StgModel::UpdateIfDue | ( | void | ) | [protected] |
References interval, last_update, Stg::StgWorld::sim_time, Update(), and world.
void StgModel::UpdatePose | ( | void | ) | [protected, virtual] |
References Stg::stg_pose_t::a, color, Stg::stg_trail_item_t::color, disabled, interval, Stg::StgWorld::interval_sim, pose, Stg::stg_trail_item_t::pose, SetPose(), SetStall(), Stg::StgWorld::sim_time, Stg::stg_pose_sum(), TestCollision(), Stg::stg_trail_item_t::time, trail, Stg::StgWorld::updates, velocity, world, Stg::stg_pose_t::x, and Stg::stg_pose_t::y.
Friends And Related Function Documentation
friend class StgAncestor [friend] |
friend class StgCanvas [friend] |
Reimplemented from Stg::StgAncestor.
friend class StgWorld [friend] |
friend class StgWorldGui [friend] |
Member Data Documentation
GPtrArray* Stg::StgModel::blinkenlights [protected] |
Referenced by AddBlinkenlight(), ClearBlinkenlights(), Draw(), DrawBlinkenlights(), and StgModel().
int Stg::StgModel::blob_return [protected] |
Referenced by SetBlobReturn(), and StgModel().
GList* Stg::StgModel::blocks [protected] |
Referenced by AddBlock(), ClearBlocks(), Stg::StgModelBlinkenlight::Draw(), DrawBlocks(), DrawPicker(), DrawTrailBlocks(), DrawTrailFootprint(), Load(), Map(), SetGeom(), StgModel(), TestCollision(), and UnMap().
bool Stg::StgModel::body_dirty [protected] |
Referenced by AddBlock(), ClearBlocks(), Load(), SetColor(), SetGeom(), and StgModel().
int Stg::StgModel::boundary [protected] |
Referenced by Load(), SetBoundary(), and StgModel().
GHashTable* Stg::StgModel::callbacks [protected] |
callback functions can be attached to any field in this structure. When the internal function model_change(<mod>,<field>) is called, the callback is triggered
Referenced by AddCallback(), CallCallbacks(), RemoveCallback(), StgModel(), and ~StgModel().
stg_color_t Stg::StgModel::color [protected] |
Referenced by GetColor(), GetProperty(), Load(), SetColor(), StgModel(), and UpdatePose().
GList* Stg::StgModel::d_list [protected] |
Referenced by StgModel().
bool Stg::StgModel::data_dirty [protected] |
bool Stg::StgModel::data_fresh [protected] |
this can be set to indicate that the model has
Referenced by DataIsFresh(), and StgModel().
bool Stg::StgModel::debug |
Reimplemented from Stg::StgAncestor.
Referenced by Stg::StgModelBlobfinder::DataVisualize(), Load(), and StgModel().
stg_bool_t Stg::StgModel::disabled [protected] |
Referenced by Disable(), Enable(), StgModel(), and UpdatePose().
int Stg::StgModel::fiducial_key [protected] |
Referenced by FiducialKey(), SetFiducialKey(), and StgModel().
int Stg::StgModel::fiducial_return [protected] |
Referenced by FiducialReturn(), GetProperty(), SetFiducialReturn(), and StgModel().
GList* Stg::StgModel::flag_list [protected] |
Referenced by AddFlag(), Draw(), DrawFlagList(), GetFlagCount(), PopFlag(), PushFlag(), RemoveFlag(), and StgModel().
stg_geom_t Stg::StgModel::geom [protected] |
Referenced by Stg::StgModelRanger::DataVisualize(), Stg::StgModelLaser::DataVisualize(), Stg::StgModelBlinkenlight::Draw(), Draw(), DrawGrid(), DrawPicker(), DrawSelected(), DrawTrailBlocks(), DrawTrailFootprint(), GetGeom(), GetGlobalPose(), Load(), LocalToGlobal(), StgModel(), Stg::StgModelBlinkenlight::StgModelBlinkenlight(), Stg::StgModelFiducial::StgModelFiducial(), Stg::StgModelLaser::StgModelLaser(), Stg::StgModelRanger::StgModelRanger(), and Stg::StgModelLaser::Update().
stg_pose_t Stg::StgModel::global_pose [protected] |
Referenced by GetGlobalPose(), and StgModel().
bool Stg::StgModel::gpose_dirty [protected] |
Referenced by GetGlobalPose(), GPoseDirtyTree(), and StgModel().
int Stg::StgModel::gripper_return [protected] |
Referenced by GetProperty(), SetGripperReturn(), and StgModel().
int Stg::StgModel::gui_grid [protected] |
Referenced by Draw(), SetGuiGrid(), and StgModel().
int Stg::StgModel::gui_mask [protected] |
Referenced by GuiMask(), SetGuiMask(), and StgModel().
int Stg::StgModel::gui_nose [protected] |
Referenced by SetGuiNose(), and StgModel().
int Stg::StgModel::gui_outline [protected] |
Referenced by SetGuiOutline(), and StgModel().
stg_id_t Stg::StgModel::id [protected] |
new data that may be of interest to users. This allows polling the model instead of adding a data callback.
Referenced by Id().
ctrlinit_t* Stg::StgModel::initfunc [protected] |
Referenced by Init(), LoadControllerModule(), Startup(), and StgModel().
stg_usec_t Stg::StgModel::interval [protected] |
Referenced by StgModel(), Stg::StgModelLaser::StgModelLaser(), UpdateIfDue(), and UpdatePose().
stg_laser_return_t Stg::StgModel::laser_return [protected] |
Referenced by GetLaserReturn(), GetProperty(), Load(), SetLaserReturn(), StgModel(), and Stg::StgModelLaser::StgModelLaser().
stg_usec_t Stg::StgModel::last_update [protected] |
Referenced by StgModel(), Update(), and UpdateIfDue().
char Stg::StgModel::load [protected] |
Referenced by AddLoadCallback(), Load(), and RemoveLoadCallback().
stg_meters_t Stg::StgModel::map_resolution [protected] |
Referenced by SetMapResolution(), and StgModel().
stg_kg_t Stg::StgModel::mass [protected] |
Referenced by GetProperty().
int Stg::StgModel::obstacle_return [protected] |
Referenced by GetProperty(), ObstacleReturn(), SetObstacleReturn(), and StgModel().
bool Stg::StgModel::on_velocity_list [protected] |
Referenced by SetVelocity(), and StgModel().
StgModel* Stg::StgModel::parent [protected] |
Referenced by GetGlobalPose(), Parent(), Root(), SetGlobalPose(), SetParent(), and ~StgModel().
stg_pose_t Stg::StgModel::pose [protected] |
Referenced by AddToPose(), Stg::StgModelRanger::DataVisualize(), Stg::StgModelBlinkenlight::Draw(), Draw(), DrawPicker(), DrawSelected(), DrawTrailArrows(), DrawTrailBlocks(), GetGlobalPose(), GetPose(), Stg::StgModelRanger::Load(), Load(), LocalToGlobal(), Raytrace(), Save(), StgModel(), Stg::StgModelRanger::StgModelRanger(), Stg::StgModelRanger::Update(), and UpdatePose().
GData* Stg::StgModel::props [protected] |
GData datalist can contain arbitrary named data items. Can be used by derived model types to store properties, and for user code to associate arbitrary items with a model.
Referenced by GetProperty(), SetProperty(), and UnsetProperty().
int Stg::StgModel::ranger_return [protected] |
Referenced by GetProperty(), GetRangerReturn(), SetRangerReturn(), and StgModel().
char Stg::StgModel::save [protected] |
Referenced by AddSaveCallback(), RemoveSaveCallback(), and Save().
char* Stg::StgModel::say_string [protected] |
if non-null, this string is displayed in the GUI
Referenced by Say(), and StgModel().
char Stg::StgModel::shutdown [protected] |
Referenced by AddShutdownCallback(), RemoveShutdownCallback(), and Shutdown().
stg_bool_t Stg::StgModel::stall [protected] |
Referenced by Draw(), Stall(), and StgModel().
char Stg::StgModel::startup [protected] |
Referenced by AddStartupCallback(), RemoveStartupCallback(), and Startup().
int Stg::StgModel::subs [protected] |
GArray* Stg::StgModel::trail [protected] |
Referenced by DrawTrailArrows(), DrawTrailBlocks(), DrawTrailFootprint(), StgModel(), and UpdatePose().
const char* Stg::StgModel::typestr [protected] |
Referenced by Stg::StgAncestor::AddChild(), GetUnsubscribedModelOfType(), and TypeStr().
char Stg::StgModel::update [protected] |
Referenced by AddUpdateCallback(), RemoveUpdateCallback(), and Update().
stg_velocity_t Stg::StgModel::velocity [protected] |
stg_watts_t Stg::StgModel::watts [protected] |
Referenced by GetProperty().
StgWorld* Stg::StgModel::world [protected] |
Referenced by DrawTrailArrows(), DrawTrailBlocks(), GetModel(), GetWorld(), Stg::StgModelRanger::Load(), Stg::StgModelPosition::Load(), Load(), Stg::StgModelLaser::Load(), Stg::StgModelFiducial::Load(), Stg::StgModelBlobfinder::Load(), Stg::StgModelBlinkenlight::Load(), Map(), NeedRedraw(), PopColor(), Print(), PushColor(), Raytrace(), Save(), SetVelocity(), Shutdown(), Startup(), Subscribe(), Unsubscribe(), Stg::StgModelPosition::Update(), Update(), UpdateIfDue(), UpdatePose(), and ~StgModel().
The documentation for this class was generated from the following files:
Generated on Thu Jan 7 17:42:17 2010 for Stage by 1.5.5