Python and Mobile I/O development

Questions about our Python API
Post Reply
Posts: 5
Joined: Tue Feb 16, 2021 12:31 pm

Python and Mobile I/O development

Post by HD-Lab_Rasmus » Tue Feb 16, 2021 12:38 pm


I received some x-actuators and I quickly managed to get them spinning in Scope and Python using, for instance, the “” from the Basis folder on the HEBI Github.

I would like to use a mobile device to control the motors using the Mobile I/O and Python, but the Python scripts I managed to find are either explicitly for an Arm like “” or for getting feedback from a Mobile device.

Does anyone have an example for Python where a Mobile device is used for setting positions and/or velocities for individual motors? Or experience with the same?

User avatar
HEBI Official
Posts: 13
Joined: Thu Jul 09, 2020 10:49 am

Re: Python and Mobile I/O development

Post by hardik_singh » Thu Feb 18, 2021 5:56 pm

Hi Rasmus,

We don't have an example that explicitly controls individual actuators using mobileIO, but the examples you are looking at do - for the most part - cover everything you would need. I would add that walking through the python API documentation at should help illuminate relevant concepts as well (in particular, the part about trajectories).

Tips as you go through these resources:
  • introduces how to send a command to a specific position to an actuator on the network. Example 03d shows how to do position and velocity simultaneously.
  • When we create a 'group' of actuators, this primarily helps us to locate and communicate on loop with the appropriate actuators on the network. For your robot, you can have all relevant actuators in a group, but still send them separate position and velocity commands.
  • The trajectories documentation shows one way to command position and velocities to multiple actuators in a given group. In this case, you feed the positions and velocity values you want as a matrix, and our trajectory generator helps with creating a motion profile that your actuators can follow. You may not want to use this setup initially, but using the trajectories eventually can make the motion for your robot smoother and safer.
  • ex_mobile_io_control exhibits how you can map behaviors / commands to different buttons on mobileIO. After you have set up your mobile device (lines 23 to 34) the list of if-statements show how you can set different behaviors for different button presses.
The examples are meant to give you a starting point, and in your case I believe it would make sense to adapt to your needs. Replace the arm setup code (lines 9-20) with your setup code for your actuators (as in the /basics examples), and replace the contents of the if-statements to do what you want at each button press.

Probably more info than you were looking for, but hope it helps!
- Hardik
Post Reply