robotemi / sdk

temi is an unparalleled robotic platform introducing a new dimension of development - movement. Using temi’s SDK, developers can create new functionalities and introduce new use cases via temi’s Android tablet. temi’s movement and navigation capabilities run off of it's Linux computer and uses a set of 16 sensors including a Lidar, depth cameras, driving cameras, and microphones. We encourage our developer community to suggest and request expanded functionality within the SDK and we will adhere to your needs. We want to enable you to create skills like never seen before! We will be constantly improving the SDK and its documentation. Please feel free to reach out to us with any questions or thoughts at developers@robotemi.com
https://www.robotemi.com/
201 stars 85 forks source link

skidJoy does not work in my Java-Code #424

Open MohmadFadiAldrobi opened 8 months ago

MohmadFadiAldrobi commented 8 months ago

Hi, I'm working on an Java-App in Androidstudio for Temi. The app should be able to remotely control Temi with the method "skidJoy(x,y,false)" (i.e. forward, backward, right, left). The problem is that Temi does not move when calling the corresponding method (see code) unless I set the method in a While(true) loop. can someone help me with this ?

public class MainActivity extends AppCompatActivity implements OnRobotReadyListener {

    private static Robot sRobot;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onStart() {
        super.onStart();
        this.sRobot = Robot.getInstance();
        this.sRobot.addOnRobotReadyListener(this);
    }

    @Override
    protected void onStop() {
        super.onStop();
        this.sRobot.removeOnRobotReadyListener(this);
    }

    @Override
    public void onRobotReady(boolean isReady) {
        if (isReady) {
            TemiGoForward(); 
        }
    }

    public void TemiGoleft(){
        sRobot.skidJoy(0,1,false);
    }

    public void TemiGoReight(){
        sRobot.skidJoy(0,-1,false);
    }

    public void TemiGoForward(){
        sRobot.skidJoy(1,0,false);
    }

    public void TemiGoBack(){
        sRobot.skidJoy(-1,0,false);
    }

}
zjn0505 commented 8 months ago

skidJoy request needs to be constantly sent to robot.

Your can add some arrow buttons in your app, and keep sending the skidJoy request when the button is pressed.