ugcs / ugcs-java-sdk

UgCS Java SDK
Other
14 stars 7 forks source link

Some help to get samples running #1

Closed kentpachi closed 8 years ago

kentpachi commented 8 years ago

Hello i'm trying to run the very first example of sample

i'm using ubuntu 14 installed ugcs server up and running ( official client can connect and the map is shown )

i've installed the sdk , moved to the target directory ( after ran the maven clean package command )

and once in the /ugcs/ugcs-java-sdk/target/ugcs-java-sdk-2.8.1/ucs-client directory i run

java -cp .;* com.ugcs.ucs.client.samples.ListenTelemetry -t 10

i have the java help shown with like i've done --help with a message at the end "cannot find command client.properties"

when i run this command

java -cp ".;*" com.ugcs.ucs.client.samples.ListenTelemetry -t 10

( notice the quotes around .;* ) it says that it can't find the main class

com.ugcs.ucs.client.samples.ListenTelemetry

any help on this ?

thanks in advance..

kentpachi commented 8 years ago

Ran command with

java -cp "*" com.ugcs.ucs.client.samples.ListenTelemetry -t 10

now it says

java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Properties.java:434) at java.util.Properties.load0(Properties.java:353) at java.util.Properties.load(Properties.java:341) at com.ugcs.ucs.client.samples.ListenTelemetry.listenTelemetry(ListenTelemetry.java:65) at com.ugcs.ucs.client.samples.ListenTelemetry.main(ListenTelemetry.java:53)

kentpachi commented 8 years ago

it seems that it cannot reads client.properties

try (InputStream in = classLoader.getResourceAsStream("client.properties")) {
            properties.load(in);
        }
episarenko commented 8 years ago

Hi! You should use a colon instead of a semicolon as a classpath separator on Linux. Launch command should look like this: java -cp .:* com.ugcs.ucs.client.samples.ListenTelemetry -t 10

kentpachi commented 8 years ago

Thank , now it runs but got something else....

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

episarenko commented 8 years ago

Samples package does not include any particular logger dependency and these lines just warn about the logger absence. You can add any SLF4J-compatible logger for the detailed output. But for these samples it's not required as everything is printed directly to the stdout. Once you connect an active vehicle (or turn on the emulator process) this sample will print drone's telemetry to the console.

kentpachi commented 8 years ago

Yep i just understood that

i've tried the waypoint command but it seems that i can't establish uplink Also i've noticed in the ugcs client the emucopter is always "red"

it seems that i have the same problem with command line

java.lang.Exception: Pas de liaison montante. at com.ugcs.ucs.client.Client.execute(Client.java:101) at com.ugcs.ucs.client.Client.execute(Client.java:107) at com.ugcs.ucs.client.samples.UploadSingleWaypointRoute$Session.uploadRoute(UploadSingleWaypointRoute.java:341) at com.ugcs.ucs.client.samples.UploadSingleWaypointRoute$Session.access$100(UploadSingleWaypointRoute.java:150) at com.ugcs.ucs.client.samples.UploadSingleWaypointRoute.uploadSingleWaypointRoute(UploadSingleWaypointRoute.java:143) at com.ugcs.ucs.client.samples.UploadSingleWaypointRoute.main(UploadSingleWaypointRoute.java:86)

"Pas de liaison montante" is the french for no uplink

episarenko commented 8 years ago

You should ensure that the emulator process is running. Here is a short excerpt from the docs:

The linux installation puts script in user binary directory which can be used to start/stop all components. The script is: /usr/local/bin/ugcs-services To launch all components, simply run the script: $ ugcs-services To stop all components, use argument stop: $ ugcs-services stop

kentpachi commented 8 years ago

Hello,

that's why i dont have such command available

i followed this http://apt.ugcs.com/doc/

but i had to install ugcs-server and not ugcs-single-host , this one wasn't available on ubuntu 14.04 LTS

Where did you find thos instructions ? i couldn't see them on the page ?

kentpachi commented 8 years ago

in usr/local/bin i've found ugcs-vehicle-emulator and ugcs-vsm-emulator ran both but it's not better..

episarenko commented 8 years ago

It seems you have everything installed and running. Could you please list ugcs components versions by running

dpkg -l | grep ugcs

Most likely your ugcs-server package version is 2.7.125 while the latest sdk package is built for the 2.8 update 1. This can cause an uplink issue. Bad news is that we did not release the ugcs-server 2.8 on Linux.

kentpachi commented 8 years ago

Output is

ii ugcs-client 2.7.125-vivid amd64 UgCS software client component ii ugcs-server 2.7.125-vivid amd64 UgCS software server component ii ugcs-vsm-emulator 2.7.125-vivid amd64 UgCS vehicle specific module (VSM) for vehicles driven by Emulator

When do you plan to release 2.8 on linux or maybe bugfix the uplink problem in a patch ?

Does that mean that i wouldn't be able to use the emulator under linux but using sdk should works just like the 2.8 version of windows/mac ?

Can i compile or "make" the program myself with sources ?

What do you advise me ?

episarenko commented 8 years ago

I've just installed ugcs-2.7 and both samples ran fine for me with the 2.8 sdk. It seems your problem is not caused by the version incompatibility. Also, the emulator process managed to report its state and register vehicle (as you can see the vehicle present in the UI). So the wire is most likely not broken. Can you please make a screenshot of the UI showing the emucopter state. Logs can also help (should be here: /var/opt/ugcs).

2.8 and 2.9 were not released on Linux. But we plan to revive Linux support in one of the next major releases.

If you have a Windows or Mac OS host I would recommend to download the 2.8 update 1 installer here https://www.ugcs.com/en/page/download. It will save your time and will let you spend more time on the sdk samples.

kentpachi commented 8 years ago

I've just installed ugcs-2.7 and both samples ran fine for me with the 2.8 sdk Under linux ? which version linux please ?

Screenshot coming soon

log.zip

kentpachi commented 8 years ago

I just reinstalled everything from scratch under linux ubunutu 14.04 and now it works great !!

emucopter is available and green on UGCS client, sdk is working fine, had to run ugcs-server and ugcs-services commands manualy tho ( maybe the default client runs them at startup and close at shutdown )

i think i found out my mistake

in sources.list it was using vivid instead of trusty... thats whay ugcs-single-host was not available at the apt-get install commands..

thank you for help i'll know work on the sdk !

sorry for disturbing

kentpachi commented 8 years ago

One last question,

is there a way to send sdk commands and view the result on ugcs client without multiclient licence ? where can i find the list of all availables commands for the sdk ?

thanks in advance

episarenko commented 8 years ago

It's not possible to have multiple clients connected simultaneously to the same server under the "Open" and "One" licenses. If you are developing a custom project on top of the UgCS platform, email us at ugcs@ugcs.com and we'll find out how to help you.

All available commands and notifications are listed in the Messages.proto protobuf schema file. These messages use domain object types declared in the Domain.proto file.

kentpachi commented 8 years ago

Yes its a custom project

i'll probably buy the pro licence this week and i'll contact you back on the email

thx for helping on this issue