TheoPierne / spot-server-js

A simple server to simulate a Spot's robot for testing purpose.
MIT License
4 stars 0 forks source link

missing docs explaining how to use this repository #1

Open nicodax opened 2 years ago

nicodax commented 2 years ago

Hello TheoPierne,

I discovered your repository by chance yesterday.

I am working with Spot and I thought it would be interesting to have some kind of a "mocked" spot for testing my functionalities.

My problem is that I am not sure how to use your server.

I did a few things already:

Could you briefly explain what the procedure to build, run and use your project is?

Thanks in advance,

nicodax

EDIT: I am using Ubuntu, dunno if this can be useful

nicodax commented 2 years ago

I saved the logs generated by npm run build, let me know if this would be helpful to share here. I didn't want to clog the message here unnecessarily

TheoPierne commented 1 year ago

Hello nicodax !

I'm glad that you plan to use my server.

To build it on ubuntu, you need some libs:

(opencv-builder requirements) (opencv4nodejs installation)

the logs seem to indicate it is missing some file (opencv2/chore.hpp) but I have no idea what it is, nor why I don't have it;

As the documentation said :

Important note: node-gyp won't handle whitespaces properly, thus make sure, that the path to your project directory does not contain any whitespaces. Installing opencv4nodejs under "C:\Program Files\some_dir" or similar will not work and will fail with: "fatal error C1083: Cannot open include file: 'opencv2/core.hpp'"!


If you already have cmake, python and no whitespaces in the path to the project, you can try running npm run rebuild. I just realize that the npm run build didn't work if you clone the project (I maybe messed up something in the npm run build command)

TheoPierne commented 1 year ago

By the way you can send the logs of the build command it maybe usefull

nicodax commented 1 year ago

Thanks for answering so quickly :)

I do have cmakeand python installed on my machine.

I cloned the repo at /media/.tomb/repos/spot-server-js so white spaces should not be an issue either.

I tried running npm run rebuilt but no success unfortunately... It is failing due to :

Error: OPENCV_INCLUDE_DIR must be define if auto-build is disabled, and autodetection failed
    at OpenCVBuildEnv.getReady

I tried removing the cloned repository and starting fresh with a new one. Here are the steps I did:

git clone git@github.com:TheoPierne/spot-server-js.git
cd spot-server-js
npm install
cd node_modules/@u4/opencv4nodejs
node-gyp configure
cd -
npm run build
npm run rebuild

Unfortunately, I hit the same errors.

Attached to this comment, you will find logs for every aforementioned command, should you want to check them:

Thanks a lot for replying, although I understand if trying to fix my problems takes too much time, I will either find a solution myself or find a way to mock bosdyn.api myself.

nicodax

nicodax commented 1 year ago

I just tried doing the process all over again with a different version of python (3.8.0 instead of 3.10.7) but logs and errors look the same

TheoPierne commented 1 year ago

Hello, sorry for the time it took me to reply.

Error: OPENCV_INCLUDE_DIR must be define if auto-build is disabled, and autodetection failed at OpenCVBuildEnv.getReady

I forgot to tell you that you have to install opencv on your ubuntu before runing the npm run rebuild :

So after installing opencv you will maybe need to reclone the project, run the command npm install and npm rebuild and you should be good! (I tested on my pc and everything works)

If you still have errors, send them with the commands you used like you did in the last messages!

TheoPierne commented 1 year ago

I will soon create a README file to specify all the step to install my project!

nicodax commented 1 year ago

Hello, no worries!

Indeed it now works... i feel stupid for asking something I probably could have figured out by myself.

Now, after npm start I get a prompt telling me the server started:

[2022-12-08 15:03:36] [info] [SERVER]: Server started with 58 services !

My next question is then: How do you authenticate to this mocked robot server ? Right now I'm only trying to make the Hello Spot tutorial from bosdyn's SDK work:

The python script prompts me for user credentials but can't connect to the server (I either get UnableToConnectToRobotError or ProxyConnectionError).

I don't know if my assumption that simply passing the server's IP (I tried with and without giving it the port number - I had to change it in src/server.js otherwise the npm start command would fail) is the way to go.

If it is (even if it isn't, actually), is there a user/pwd combo that allows authentication to your server ? Or maybe a token ?

Thanks in advance,

nicodax