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

missing docs explaining how to use this repository #1

Open
nicodax opened this issue Nov 18, 2022 · 8 comments
Open

missing docs explaining how to use this repository #1

nicodax opened this issue Nov 18, 2022 · 8 comments

Comments

@nicodax
Copy link

nicodax commented Nov 18, 2022

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:

  • ran npm install;
  • ran npm run build a first time - error logs pointed me to install node-gyp, which I did;
  • ran npm run build a second time - error logs pointed me to run node-gyp configure first, which I also did. but node-gyp couldn't find the file binding.gyp. Reading from the logs I guessed that it was looking for the file in /node_modules/@u4/opencv4nodejs/binding.js. The documentation for node-gyp said the configure command was looking for a binding.gyp file in the current directory, so I ran the command from there. It seemed to work fine;
  • ran npm run build a third time - 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;

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
Copy link
Author

nicodax commented Nov 18, 2022

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
Copy link
Owner

Hello nicodax !

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

To build it on ubuntu, you need some libs:

  • cmake
  • python (for node-gyp)

(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
Copy link
Owner

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

@nicodax
Copy link
Author

nicodax commented Nov 25, 2022

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
Copy link
Author

nicodax commented Nov 25, 2022

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
Copy link
Owner

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 :

  • sudo apt install libopencv-dev (can take some time depend on your internet and computer specs)

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
Copy link
Owner

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

@nicodax
Copy link
Author

nicodax commented Dec 8, 2022

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:

  • I tried running it on my local machine and passing 0.0.0.0 as the robot IP;
  • I tried running your project inside a docker container (I made a few edits to you project for it to work) and passing the container's IP as the robot IP;

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

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