commaai / bodyjim

A gymnasium environment for the comma body
MIT License
25 stars 1 forks source link

pip install bodyjim error #8

Open SAJIB3489 opened 1 month ago

SAJIB3489 commented 1 month ago

Hello,

I have a Comma3x. I would like to use my Jetson orin nano instead of Comma body to install the packages and test them.

I getting error to install the package. Is it possible to install the bodyjim package without comma body?

Here is the error. Screenshot from 2024-06-04 16-43-29

Thank you.

fredyshox commented 1 month ago

Yes, the package should definitely install on non-comma hardware. I think your issue might be connected with the fact that you're using python3.12 in which diskutils was removed from standard library. Try following the steps from this post: https://stackoverflow.com/questions/69919970/no-module-named-distutils-but-distutils-installed and then try again.

SAJIB3489 commented 1 month ago

Sorry, I have tried all possible way, but did not work. Screenshot from 2024-06-05 15-47-33

SAJIB3489 commented 1 month ago

Well. I was able install the pip install bodyjim and additional dependencies using python3.11 -m pip install <dependencies name> .

After that I have connected the Comma3x (installed openpilot 0.9.6) with my Jetson orin nano on C port (attachedment). I check that comma3x is connected properly then I run the following command (inluding Orin ip address) on Jetson Orin.

python3.11 examples/follow_human.py 192.168.0.101

The error showing (I was in front of the comma3x camera when I ran).

pygame 2.5.2 (SDL 2.28.3, Python 3.11.9)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1025, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1086, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1070, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 974, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 638, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 678, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.0.101', 5001)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/helsinki/Downloads/body-jim/examples/follow_human.py", line 182, in <module>
    run_follow_human(args.body_ip)
  File "/home/helsinki/Downloads/body-jim/examples/follow_human.py", line 122, in run_follow_human
    env = BodyEnv(body_ip, ["driver"], [], render_mode="human")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/bodyjim/env.py", line 36, in __init__
    schema = asyncio.run(client.get_schema(services))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/bodyjim/data_stream.py", line 36, in get_schema
    async with session.get(endpoint, params=params) as resp:
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/client.py", line 1197, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/client.py", line 581, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 544, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 944, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1257, in _create_direct_connection
    raise last_exc
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1226, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1033, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.0.101:5001 ssl:default [Connect call failed ('192.168.0.101', 5001)]

WhatsApp Image 2024-06-05 at 17 20 51

Screenshot from 2024-06-05 17-14-16

Armandpl commented 1 month ago

The example scripts are meant to be ran from a remote machine. If you want to run them from the orin to control the commabody, the ip needs to be the comma 3x ip

SAJIB3489 commented 1 month ago

Thank you for your information but it does not work either.

Error:

$ python3.11 examples/follow_human.py 192.168.0.179

pygame 2.5.2 (SDL 2.28.3, Python 3.11.9)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1025, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1086, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1070, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 974, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 638, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 678, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.0.179', 5001)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/helsinki/Downloads/body-jim/examples/follow_human.py", line 182, in <module>
    run_follow_human(args.body_ip)
  File "/home/helsinki/Downloads/body-jim/examples/follow_human.py", line 122, in run_follow_human
    env = BodyEnv(body_ip, ["driver"], [], render_mode="human")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/bodyjim/env.py", line 36, in __init__
    schema = asyncio.run(client.get_schema(services))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/bodyjim/data_stream.py", line 36, in get_schema
    async with session.get(endpoint, params=params) as resp:
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/client.py", line 1197, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/client.py", line 581, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 544, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 944, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1257, in _create_direct_connection
    raise last_exc
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1226, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/helsinki/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1033, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.0.179:5001 ssl:default [Connect call failed ('192.168.0.179', 5001)]
Armandpl commented 1 month ago

For the webrtc server on the comma to accept connections it has to be in joystick mode. On the body this is done by pressing a physical button which you don't have here. Try echo -n "1" > /data/params/d/JoystickDebugMode on you comma.