Skip to content

Misty2: Python wrapper: failing to connect #10

Open

Description

@jhielson

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

Activity

  1. Kakcalu13 commented on May 14, 2024

    @Kakcalu13

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions