Unable to Move Arm with the Moble App

An Android / iOS application for getting mobile device sensor input and general-purpose input/output onto the HEBI API.
Post Reply
RoboEngineer
Posts: 3
Joined: Sun Jan 24, 2021 1:30 am

Unable to Move Arm with the Moble App

Post by RoboEngineer » Sun Jan 24, 2021 1:53 am

I have a 5DOF arm and on Scope I see the all the arm joints and the Iphone with the mobile app and everything is green. When I move the Iphone the arm doesn't move. When I move the joysticks or press any of the analog buttons nothing happens on the arm. What else do I need to configure to move the robotic arm?
User avatar
hardik_singh
HEBI Official
Posts: 13
Joined: Thu Jul 09, 2020 10:49 am

Re: Unable to Move Arm with the Moble App

Post by hardik_singh » Mon Jan 25, 2021 11:20 am

Hello!

To have the phone control the arm, you need to be running some code in the API of your choice. We primarily support MATLAB, Python, C++, and ROS, and you can get more info about these APIs at https://docs.hebi.us/tools.html#Tools_APIs.

We provide example code for you to get started, and you will find the code you are looking for in the each api's respective github repository, which you can find on the page linked above. The example code to control the arm using the phone will be found in the kits/arm/ folder of the API repo of your choice.

I also recommend reading through the documentation for your chosen API on docs.hebi.us to get up and running properly. Let me know how it goes!
RoboEngineer
Posts: 3
Joined: Sun Jan 24, 2021 1:30 am

Re: Unable to Move Arm with the Moble App

Post by RoboEngineer » Sun Feb 14, 2021 9:59 pm

Hi Hardik_singh,

Thank you for the previous post. I was able to get further along with the help of the Python3 AR_ARM_KIT_W_GRIPPER example and modified it for my 5DoF w/ gripper. However, I am running into an issue with the example where the mobileIO (i.e. IPhone) rotation matrix is not accepted as valid by the program. Below is the error output. Any help is appreciated.

################################################################
Waiting for Mobile IO device to come online...
Traceback (most recent call last):
File "ex_AR_kit_w_gripper.py", line 151, in <module>
target_joints = arm.ik_target_xyz_so3(arm.last_feedback.position, xyz_target, rot_target)
File "/home/user/.local/lib/python3.6/site-packages/hebi/arm.py", line 563, in ik_target_xyz_so3
objectives.append(robot_model_api.endeffector_so3_objective(orientation))
File "/home/user/.local/lib/python3.6/site-packages/hebi/robot_model.py", line 1344, in endeffector_so3_objective
raise ValueError('Input rotation matrix is not SO(3). Determinant={}'.format(det))
ValueError: Input rotation matrix is not SO(3). Determinant=0.0
################################################################
User avatar
hardik_singh
HEBI Official
Posts: 13
Joined: Thu Jul 09, 2020 10:49 am

Re: Unable to Move Arm with the Moble App

Post by hardik_singh » Tue Feb 16, 2021 2:46 pm

Hi RoboEngineer,

We're currently working to debug your issue. Though I'm not sure it will make a difference here, I think you have a slightly older version of the python API. I would recommend downloading the latest release to keep updated with our latest fixes. If we don't get back to you in the meantime, let us know if the update fixes your issue.
RoboEngineer
Posts: 3
Joined: Sun Jan 24, 2021 1:30 am

Re: Unable to Move Arm with the Moble App

Post by RoboEngineer » Wed Feb 17, 2021 8:44 pm

Hi Hardik_singh,

I did a fresh install of the Hebi API and noted that I wasn't able to install using the pip install hebi-py command but was able to install using pip3 install hebi-py. I figured that pip3 was fine since I'm using python3 to run the example scripts.

Here is the error I get when install with pip command.
###################################
pip install hebi-py
Collecting hebi-py
Using cached https://files.pythonhosted.org/packages ... 3.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-zFEYuq/hebi-py/setup.py", line 22
api_reference_url = f"http://docs.hebi.us/docs/python/{api_version}"
^
SyntaxError: invalid syntax

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-zFEYuq/hebi-py/
####################################

Note: I still get the same error with the rotation matrix input is not accepted with the latest Hebi API 2.3.0.
User avatar
hardik_singh
HEBI Official
Posts: 13
Joined: Thu Jul 09, 2020 10:49 am

Re: Unable to Move Arm with the Moble App

Post by hardik_singh » Thu Feb 18, 2021 12:33 pm

Regarding pip3 vs pip
Depending on your system, pip install may still be using python 2, whereas pip3 install ensures you are working with python 3. Because our python api is only built to work with python 3, pip install may not work if it is trying to install our api in a python 2 environment. As such, your assumption to use pip3 install was correct.

With regards to your initial issue with the arm
I tried to recreate the bug you are experiencing with a 5-DoF_w_gripper arm, but everything was working as expected on my end. This was my process:

I started with the latest Python 2.3.0 release, in a fresh clone of the hebi_python_examples repo master branch, with the file ex_AR_kit_w_gripper.py.

In this file, I changed only 4 lines of code:
Before:

Code: Select all

38 module_names = ['J1_base', 'J2_shoulder', 'J3_elbow', 'J4_wrist1', 'J5_wrist2', 'J6_wrist3']
39 hrdf_file    = "hrdf/A-2085-06G.hrdf"
40 gains_file   = "gains/A-2085-06.xml"
72 home_position = [0, np.pi/3, 2*np.pi/3, 5*np.pi/6, -np.pi/2, 0]
After:

Code: Select all

38 module_names = ['J1_base', 'J2_shoulder', 'J3_elbow', 'J4_wrist1', 'J5_wrist2']
39 hrdf_file    = "hrdf/A-2085-05G.hrdf"
40 gains_file   = "gains/A-2085-05.xml"
72 home_position = [0, np.pi/3, 2*np.pi/3, 5*np.pi/6, -np.pi/2]
In short, I updated the module_names, hrdf_file, gains_file, and home_position by removing the last degree of freedom (J6_wrist3). With just these changes, the remaining math/code in the file should still work, and I am able to run a 5_DoF_w_gripper arm ARkit demo using this example code.

Have you made a different set of changes to your code? If you follow the same process I did, do you experience the same bug as earlier? If you're still experiencing some issues, it would help if you could send code snippets or screenshots of how you are configuring the file to go from 6-DoF to 5-DoF.

Hope this helps!
Hardik
Post Reply