Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misty2: Python wrapper: failing to connect #10

Open
jhielson opened this issue Jan 23, 2023 · 1 comment
Open

Misty2: Python wrapper: failing to connect #10

jhielson opened this issue Jan 23, 2023 · 1 comment

Comments

@jhielson
Copy link

Hi,

I have been following the instructions but I cannot get the robot connected. When I use the same IP in my browser it works fine, I can access Misty Studio.

Traceback (most recent call last):
  File "/home/jhielson/ros_ws/src/misty_wrapper/src/example.py", line 5, in <module>
    misty = Robot("192.168.1.108") # This is the IP of my misty. Replace with your IP
  File "/home/jhielson/anaconda3/envs/mistyWrapper/lib/python3.9/site-packages/mistyPy/__init__.py", line 27, in __init__
    self.populateImages()
  File "/home/jhielson/anaconda3/envs/mistyWrapper/lib/python3.9/site-packages/mistyPy/__init__.py", line 93, in populateImages
    for out in reply["result"]:
TypeError: string indices must be integers
@Kakcalu13
Copy link

ohhh lol i LITERALLY just fixed this.

prob too late but im sharing for everyone in future

the solution:
def populateImages(self):
self.images_saved = []
resp = requests.get('http://' + self.ip + '/api/images/list')
new_data = resp.json()
for get_name in new_data['result']:
self.images_saved.append(get_name['name'])

the code was probably extremely outdated. I updated the code to latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants