ロボット実践教材
91/132

次世代ロボットエンジニア育成の ミドルウェアを活用した実践的教育プログラム開発 - 89 - 作成したプログラムをコンパイル、リンクをして実行可能になったプログラムを実行してみよう。 if (m_status != -1) { if (m_in_lightctlIn.isNew( )) { m_in_lightctlIn.read( ); if (m_in_lightctl.data > -1 && m_in_lightctl.data < 10){ m_moving = m_in_lightctl.data; m_status = 1; m_out_srvcmd.data = m_moving; m_out_srvcmdOut.write( ); } } if (m_in_shotctlIn.isNew( )) { m_in_shotctlIn.read( ); switch (m_in_shotctl.data) { case 1: m_status = 1; if (m_moving > 0) { m_out_srvcmd.data = 0; m_out_srvcmdOut.write( ); } m_out_srvcmd.data = 5; m_out_srvcmdOut.write( ); break; case 0: m_status = 1; if (m_moving > 0) { m_out_srvcmd.data = m_moving; m_out_srvcmdOut.write( ); } break; default: break; } } } return RTC::RTC_OK; } プログラムファイル(MovingCtrl.cpp) つづき

元のページ 

10秒後に元のページに移動します

※このページを正しく表示するにはFlashPlayer9以上が必要です