changeset 234:5657cf2325c9 main

Updates to the simulator. Minor tweaks to the controls.
author Bob Cook <bob@bobcookdev.com>
date Sun, 13 Jul 2014 09:13:15 -0700
parents b9288cad0bfb
children 493f994c999a
files main/robots/odr-sim/SimDisplay.cpp main/robots/odr-sim/SonarFrontStatus.cpp main/robots/odr-sim/odrsim.log
diffstat 3 files changed, 40 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/main/robots/odr-sim/SimDisplay.cpp	Sun Jul 13 09:12:48 2014 -0700
+++ b/main/robots/odr-sim/SimDisplay.cpp	Sun Jul 13 09:13:15 2014 -0700
@@ -134,32 +134,6 @@
 
 // ----------------------------------------------------------------------------------------
 
-static void PressButtonOneCB( Fl_Widget* widget, void* value )
-{
-    Fl_Toggle_Button* button = dynamic_cast< Fl_Toggle_Button* >( widget );
-    if ( button == 0 )
-    {
-        return; // opps, not what we thought?!
-    }
-
-    //ControllerStatus::setButtonOne( button->value() != 0 );
-}
-
-// ----------------------------------------------------------------------------------------
-
-static void PressButtonTwoCB( Fl_Widget* widget, void* value )
-{
-    Fl_Toggle_Button* button = dynamic_cast< Fl_Toggle_Button* >( widget );
-    if ( button == 0 )
-    {
-        return; // opps, not what we thought?!
-    }
-
-    //ControllerStatus::setButtonTwo( button->value() != 0 );
-}
-
-// ----------------------------------------------------------------------------------------
-
 static void ImuKeepAliveCB( Fl_Widget* widget, void* value )
 {
     static ImuStatus    s_imuStatusRunnable;
@@ -562,8 +536,6 @@
         m_buttonDisplayAlive->label( "Display Alive" );
         m_buttonDisplayAlive->selection_color( FL_GREEN );
         m_buttonDisplayAlive->callback( &DoDisplayStatusCB );
-        //m_buttonDisplayAlive->set();
-        //m_buttonDisplayAlive->do_callback();
     }
 
     m_buttonGpsAlive = new Fl_Light_Button( 250, 50, 165, 20 );
@@ -572,8 +544,6 @@
         m_buttonGpsAlive->label( "GPS Alive" );
         m_buttonGpsAlive->selection_color( FL_GREEN );
         m_buttonGpsAlive->callback( &DoGpsStatusCB );
-        //m_buttonGpsAlive->set();
-        //m_buttonGpsAlive->do_callback();
     }
 
     m_buttonMotionAlive = new Fl_Light_Button( 250, 80, 165, 20 );
@@ -584,6 +554,7 @@
         m_buttonMotionAlive->callback( &DoMotionStatusCB );
     }
 
+#if 0
     m_buttonA = new Fl_Toggle_Button( 250, 110, 80, 20 );
     if ( m_buttonA )
     {
@@ -597,6 +568,7 @@
         m_buttonB->label( "B" );
         m_buttonB->callback( &PressButtonTwoCB );
     }
+#endif
 
     m_window->end();
 }
@@ -628,7 +600,7 @@
     {
         m_dialImuHeading->box( FL_ROUND_UP_BOX );
         m_dialImuHeading->bounds( 0.0, 360.0 );
-        m_dialImuHeading->value( ImuStatus::imuYaw() );
+        m_dialImuHeading->value( 180.0 );
         m_dialImuHeading->callback( ImuHeadingDialCB, this );
     }
 
@@ -637,8 +609,8 @@
     {
         m_sliderImuPitch->label( "Pitch" );
         m_sliderImuPitch->slider( FL_UP_BOX );
-        m_sliderImuPitch->bounds( 0.0, 20.0 );
-        m_sliderImuPitch->value( ImuStatus::imuPitch() );
+        m_sliderImuPitch->bounds( 20.0, -20.0 );
+        m_sliderImuPitch->value( 0.0 );
         m_sliderImuPitch->callback( ImuPitchSliderCB, this );
     }
 
@@ -647,8 +619,8 @@
     {
         m_sliderImuRoll->label( "Roll" );
         m_sliderImuRoll->slider( FL_UP_BOX );
-        m_sliderImuRoll->bounds( 0.0, 20.0 );
-        m_sliderImuRoll->value( ImuStatus::imuRoll() );
+        m_sliderImuRoll->bounds( 20.0, -20.0 );
+        m_sliderImuRoll->value( 0.0 );
         m_sliderImuRoll->callback( ImuRollSliderCB, this );
     }
 
@@ -682,7 +654,7 @@
     {
         m_sliderSonarFrontL->label( "Left" );
         m_sliderSonarFrontL->slider( FL_UP_BOX );
-        m_sliderSonarFrontL->bounds( 0xff, 0 );
+        m_sliderSonarFrontL->bounds( 100, 0 );
         m_sliderSonarFrontL->value( SonarFrontStatus::sonarFrontLeft() );
         m_sliderSonarFrontL->callback( SonarFrontSliderLeftCB, this );
     }
@@ -692,7 +664,7 @@
     {
         m_sliderSonarFrontCL->label( "C Left" );
         m_sliderSonarFrontCL->slider( FL_UP_BOX );
-        m_sliderSonarFrontCL->bounds( 0xff, 0 );
+        m_sliderSonarFrontCL->bounds( 100, 0 );
         m_sliderSonarFrontCL->value( SonarFrontStatus::sonarFrontCenterLeft() );
         m_sliderSonarFrontCL->callback( SonarFrontSliderCenterLeftCB, this );
     }
@@ -702,7 +674,7 @@
     {
         m_sliderSonarFrontCR->label( "C Right" );
         m_sliderSonarFrontCR->slider( FL_UP_BOX );
-        m_sliderSonarFrontCR->bounds( 0xff, 0 );
+        m_sliderSonarFrontCR->bounds( 100, 0 );
         m_sliderSonarFrontCR->value( SonarFrontStatus::sonarFrontCenterRight() );
         m_sliderSonarFrontCR->callback( SonarFrontSliderCenterRightCB, this );
     }
@@ -712,7 +684,7 @@
     {
         m_sliderSonarFrontR->label( "Right" );
         m_sliderSonarFrontR->slider( FL_UP_BOX );
-        m_sliderSonarFrontR->bounds( 0xff, 0 );
+        m_sliderSonarFrontR->bounds( 100, 0 );
         m_sliderSonarFrontR->value( SonarFrontStatus::sonarFrontRight() );
         m_sliderSonarFrontR->callback( SonarFrontSliderRightCB, this );
     }
--- a/main/robots/odr-sim/SonarFrontStatus.cpp	Sun Jul 13 09:12:48 2014 -0700
+++ b/main/robots/odr-sim/SonarFrontStatus.cpp	Sun Jul 13 09:13:15 2014 -0700
@@ -84,10 +84,10 @@
 
 Poco::RWLock SonarFrontStatus::sm_rwLock;
 bool         SonarFrontStatus::sm_isEnabled   = false;
-uint8_t      SonarFrontStatus::sm_left        = 0xdf;
-uint8_t      SonarFrontStatus::sm_centerLeft  = 0xdf;
-uint8_t      SonarFrontStatus::sm_centerRight = 0xdf;
-uint8_t      SonarFrontStatus::sm_right       = 0xdf;
+uint8_t      SonarFrontStatus::sm_left        = 60;
+uint8_t      SonarFrontStatus::sm_centerLeft  = 60;
+uint8_t      SonarFrontStatus::sm_centerRight = 60;
+uint8_t      SonarFrontStatus::sm_right       = 60;
 
 // ----------------------------------------------------------------------------------------
 
--- a/main/robots/odr-sim/odrsim.log	Sun Jul 13 09:12:48 2014 -0700
+++ b/main/robots/odr-sim/odrsim.log	Sun Jul 13 09:13:15 2014 -0700
@@ -314,3 +314,28 @@
 I 07/12/14-22:25:54.573945 ODRSimApp::main() started
 I 07/12/14-22:25:54.574036 using CANbus interface name "can0"
 I 07/12/14-22:29:47.876123 ODR H/W Simulator shutdown
+I 07/13/14-01:04:28.359774 ------------------------------------------------------
+I 07/13/14-01:04:28.359885 ODR H/W Simulator startup
+I 07/13/14-01:04:28.359899 ODRSimApp::main() started
+I 07/13/14-01:04:28.359991 using CANbus interface name "can0"
+I 07/13/14-01:05:03.108401 ODR H/W Simulator shutdown
+I 07/13/14-01:08:11.853011 ------------------------------------------------------
+I 07/13/14-01:08:11.853286 ODR H/W Simulator startup
+I 07/13/14-01:08:11.853303 ODRSimApp::main() started
+I 07/13/14-01:08:11.853549 using CANbus interface name "can0"
+I 07/13/14-01:20:18.090331 ODR H/W Simulator shutdown
+I 07/13/14-01:25:10.431615 ------------------------------------------------------
+I 07/13/14-01:25:10.431829 ODR H/W Simulator startup
+I 07/13/14-01:25:10.431857 ODRSimApp::main() started
+I 07/13/14-01:25:10.432053 using CANbus interface name "can0"
+I 07/13/14-01:26:01.485262 ODR H/W Simulator shutdown
+I 07/13/14-01:26:24.930296 ------------------------------------------------------
+I 07/13/14-01:26:24.930404 ODR H/W Simulator startup
+I 07/13/14-01:26:24.930418 ODRSimApp::main() started
+I 07/13/14-01:26:24.930510 using CANbus interface name "can0"
+I 07/13/14-01:27:00.229683 ODR H/W Simulator shutdown
+I 07/13/14-01:31:20.908956 ------------------------------------------------------
+I 07/13/14-01:31:20.909050 ODR H/W Simulator startup
+I 07/13/14-01:31:20.909060 ODRSimApp::main() started
+I 07/13/14-01:31:20.909127 using CANbus interface name "can0"
+I 07/13/14-01:36:17.269122 ODR H/W Simulator shutdown