public boolean manualControlMove ( float rotationSpeed , float speed , int runDuration ) throws CommandExecutionException { if ( manualControlSequence < 1 ) manualControlStart ( ) ; JSONObject payload = new JSONObject ( ) ; if ( rotationSpeed > 180.0f ) rotationSpeed = 180.0f ; if ( rotationSpeed < - 180.0f ) rotationSpeed = - 180.0f ; float rotationRadians = Math . round ( ( rotationSpeed / 180.0f ) * 272.0d ) / 100.0f ; //Found out after LOADS of tests. payload . put ( "omega" , rotationRadians ) ; if ( speed >= 0.3f ) speed = 0.29f ; if ( speed <= - 0.3f ) speed = - 0.29f ; payload . put ( "velocity" , speed ) ; if ( runDuration < 0 ) runDuration = 1000 ; payload . put ( "duration" , runDuration ) ; payload . put ( "seqnum" , manualControlSequence ) ; manualControlSequence ++ ; JSONArray send = new JSONArray ( ) ; send . put ( payload ) ; return sendOk ( "app_rc_move" , send ) ; }
Manually control the robot