Permalink
Browse files

cleaning up gripper and adding visualization

  • Loading branch information...
1 parent 754ffa5 commit 4efd7641048f78b8e83e782ebb265599771dc863 rtv committed Feb 15, 2009
Showing with 179 additions and 291 deletions.
  1. +6 −6 examples/ctrl/fasr.cc
  2. +5 −0 libstage/gl.cc
  3. +96 −236 libstage/model_gripper.cc
  4. +42 −10 libstage/model_laser.cc
  5. +25 −34 libstage/stage.hh
  6. +5 −5 worlds/fasr.world
View
@@ -115,7 +115,7 @@ class Robot
void Dock()
{
// close the grippers so they can be pushed into the charger
- ModelGripper::data_t gripper_data = gripper->GetData();
+ ModelGripper::config_t gripper_data = gripper->GetConfig();
if( gripper_data.paddles != ModelGripper::PADDLE_CLOSED )
gripper->CommandClose();
@@ -183,7 +183,7 @@ class Robot
pos->SetXSpeed( 0.0 );
// once we have backed off a bit, open and lower the gripper
- ModelGripper::data_t gripper_data = gripper->GetData();
+ ModelGripper::config_t gripper_data = gripper->GetConfig();
if( charger_range > gripper_distance )
{
if( gripper_data.paddles != ModelGripper::PADDLE_OPEN )
@@ -284,7 +284,7 @@ class Robot
{
if( verbose ) puts( "Cruise" );
- ModelGripper::data_t gdata = gripper->GetData();
+ ModelGripper::config_t gdata = gripper->GetConfig();
//avoidcount = 0;
pos->SetXSpeed( cruisespeed );
@@ -303,7 +303,7 @@ class Robot
if( y < 0 ) y = 0;
double a_goal =
- dtor( ( pos->GetFlagCount() || gdata.stack_count ) ? have[y][x] : need[y][x] );
+ dtor( ( pos->GetFlagCount() || gdata.gripped ) ? have[y][x] : need[y][x] );
// if we are low on juice - find the direction to the recharger instead
if( Hungry() )
@@ -481,8 +481,8 @@ class Robot
static int GripperUpdate( ModelGripper* grip, Robot* robot )
{
- ModelGripper::data_t gdata = grip->GetData();
-
+ ModelGripper::config_t gdata = grip->GetConfig();
+
printf( "BREAKBEAMS %s %s\n",
gdata.beam[0] ? gdata.beam[0]->Token() : "<null>",
gdata.beam[1] ? gdata.beam[1]->Token() : "<null>" );
View
@@ -50,6 +50,11 @@ void Stg::Gl::draw_octagon( float w, float h, float m )
glEnd();
}
+void Stg::Gl::draw_centered_rect( float x, float y, float dx, float dy )
+{
+ glRectf( x-0.5*dx, y-0.5*dy, x+0.5*dx, y+0.5*dy );
+}
+
void Stg::Gl::draw_vector( double x, double y, double z )
{
glBegin( GL_LINES );
Oops, something went wrong.

0 comments on commit 4efd764

Please sign in to comment.