isl-org / OpenBot

OpenBot leverages smartphones as brains for low-cost robots. We have designed a small electric vehicle that costs about $50 and serves as a robot body. Our software stack for Android smartphones supports advanced robotics workloads such as person following and real-time autonomous navigation.
https://www.openbot.org
MIT License
2.82k stars 528 forks source link

A Issue In Python Controller #189

Closed Twisted-Fates closed 3 years ago

Twisted-Fates commented 3 years ago

Hello! When I open keyboard-pygame.py or keyboard-click.py,the phone can't connect my computer(Windows 10).

thias15 commented 3 years ago

Can you please elaborate on the problem. Are you seeing some error message? Did you toggle to the "smartphone controller" on the OpenBot app.

Twisted-Fates commented 3 years ago

Thankyou for your reply! This is my problem:

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年5月8日(星期六) 凌晨0:45 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [intel-isl/OpenBot] A Issue In Python Controller (#189)

Can you please elaborate on the problem. Are you seeing some error message? Did you toggle to the "smartphone controller" on the OpenBot app.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

thias15 commented 3 years ago

I assume you pasted a screenshot, but it does not show up on Github. Can you please try again or post in the Slack channel? Some general troubleshooting tips:

Twisted-Fates commented 3 years ago

QQ截图20210508141213 QQ截图20210508141230

Twisted-Fates commented 3 years ago

QQ截图20210508151255

Please help me. I don't know how to deal with it.

thias15 commented 3 years ago

It looks like you executed the pip install -r requirements.txt before activating the environment and it installed it in the base environment. So try conda deactivate so you are in the base environment where it seems to be installed and then run the script.

When you are in the openbot conda environment it seems pygame cannot be found which seems very strange since it is very common. You could also try to install pygame via conda using the command conda install -c cogsci pygame after activating the environment.

Twisted-Fates commented 3 years ago

344MP69ZTT2$7VRQ5ZP (4N

As you can see,when I use command conda install pygame it will wrong.

QQ截图20210508221430

And I also try to run the script when conda deactivate but it always show "waiting for connection" and can't connect successfully.

微信图片_20210508221612

thias15 commented 3 years ago

When you run the conda install the error message states you don't have the channels for pygame, so you need to try the command I posted above: conda install -c cogsci pygame

thias15 commented 3 years ago

When you do not have the environment activated and you see "Waiting for connection", this is the expected behavior, so it seems to be working. However, it seems the devices cannot see each other. If your router has a 2.4Ghz and 5Ghz mode, it could be that the phone and laptop are connected to different versions of your network. So you can try to disable the 5Ghz band on your router.

thias15 commented 3 years ago

Are phone and laptop connected to the same WiFi? Do both have a valid IP address?

Twisted-Fates commented 3 years ago

My laptop create a Mobile hotspot and phone connect to it.

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年5月9日(星期天) 凌晨1:51 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [intel-isl/OpenBot] A Issue In Python Controller (#189)

Are phone and laptop connected to the same WiFi? Do both have a valid IP address?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

thias15 commented 3 years ago

We have not tested it, but I don't know if a direct connection works at this point. Can you connect both the phone and laptop to a router?

thias15 commented 3 years ago

@izivkov do you have any intuition if a direct connection via hotspot would work?

izivkov commented 3 years ago

I think somebody had a similar problem before. They resolved it by using one phone as a hotspot, and two other phones for the controller and the bot. They had problem if one of the phone was used as the hotspot and running the controller or the bot software on it. I think it has to do with how services are discovered on the network.

The connection was meant to be used as two devices on the same network connected to the same router.

Twisted-Fates commented 3 years ago

Thankyou for your reply! I will have a try.

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年5月10日(星期一) 上午6:03 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [intel-isl/OpenBot] A Issue In Python Controller (#189)

The connection was meant to be used as two devices on the same network connected to the same router.

I think somebody had a similar problem before. They resolved it by using one phone as a hotspot, and two other phones for the controller and the bot. They had problem if one of the phone was used as the hotspot and running the controller or the bot software on it. I think it has to do with how services are discovered on the network.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

thias15 commented 3 years ago

Also, you can try the latest OpenBot app version from master. You can download it from here.

Twisted-Fates commented 3 years ago

O$ZKVMC O{$)3@_RI4AN AN B`THY6I_UEMVJB}}{3OV_06

thias15 commented 3 years ago

Ok, it seems the pygame in the conda channel needs python 3.5. So you need to downgrade your python installation. Or use the Installation outside the conda environment.

thias15 commented 3 years ago

Did you try the app version I liked above outside the conda environment where the pygame installation had worked?

thias15 commented 3 years ago

Any update?

Twisted-Fates commented 3 years ago

Sorry!I am busy recently.(crying...)

thias15 commented 3 years ago

Closing due to inactivity. If the problem persists, feel free to open again.