Open Tahaan opened 3 years ago
try
final time = Time.now();
That would just give the local time on the device.
Or am I missing something?
No that is the Ros subscription to the time. DateTime.now() is the computer / dart local time.
Implementation here: https://github.com/TimWhiting/dartros/blob/master/lib/src/time.dart
OK, thank you. It works as far as I can tell. Hard to verify but by changing my local time a couple of seconds, I managed to get it to give me a different result.
Which leaves me still not knowing where my messages gets lost.
Are you on the same network? Are other things working? Is the ROS_MASTER_URI set properly as well as the ROS_IP on the phone. Just a few things you could check. Typically if there are problems with publishing and not subscribing I would check the ROS_IP
I'm not on the same network, The Ros server is 1500 Kms away in another city. I have port forwarding over SSH to connect to the Ros system.
My MASTER_URI points to the host:port on my local lan which forwards to the ros system.
When I connect to it via a browser, I get a message which gives an error which tells me that it is working.
Error response
Error code: 501
Message: Unsupported method ('GET').
Error code explanation: HTTPStatus.NOT_IMPLEMENTED - Server does not support this operation.
If I close the SSH tunnel then in stead of the above I get a connection refused
How does the Ros server initiate connections with you then? You would need port forwarding from the server back to your phone.
ROS has servers on both devices and each connects to each other, (i.e. this package spins up a server that talks to the master server at ROS_MASTER_URI) and they have to know each other's IP addresses and be able to initiate connections both ways. That way a process that spins up can create outbound connections and listen to inbound connections to do both publishing and subscribing. If the server is told to connect to the IP address of your device to connect to a certain publisher, it needs to be able to access your phone's IP address. Can you try pinging from the server to your phone. The phone's IP address is likely to change and cause problems that way unless you give it a static IP on a VPN that is accessible to the server.
Somehow I missed your response until now. I will set up revese port forwarding - I did not know it was needed.
I will report back once I have been able to test.
Is there a way to query the time?
I'm very new to anything ROS and, for that matter, a total noob on all of this.
I'm trying to send a Twist command form an Android app to a topic like this:
Since "nothing appears to happen" I'm trying to debug it and was hoping for a get_time or something that can tell me that it is really connected.
Note that I have found no documentation on what to pass to the args parameter of the initNode... So perhaps that is where the problem lies?