-
Notifications
You must be signed in to change notification settings - Fork 1
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
ReceivedDataStructure - can't seem to figure out how to make it work #4
Comments
Your code doesn't work because the subscriber instance is destroyed when your
Error code 4 means that the driver has returned an error: https://github.com/UAVCAN/libuavcan/blob/0dc5751ffd905f63096fb4d15485e1a1510635e5/libuavcan/include/uavcan/error.hpp#L28 |
Hi Pavel
Read that and wanted to see if I could print it out using the ostream method that I saw in the subscriber example I was looking at: https://uavcan.org/Implementations/Libuavcan/Tutorials/3._Publishers_and_subscribers/. Running the subscriber from callback works great.
So if I put // create a subscriber
Will check that one out. |
Yes, or just make it static. |
Ok. After a couple of tries I got it working with this layout for initSubscriber::
It does printout the longitude piece of the msg. But ostream is not printing. But I think that is a function of the Teensy compiler and printf function not implemented the way it should be. I will work the timeout issue after I get this working. |
Hey, |
Since this is not really an issue related to this repository I will close it for now (you may reopen if you think it is valid here). |
@fabolhak
It compiles fine without it. Also had to add #define printf Serial.printf to the main sketch or in the subscriber.h file as well as deleting the code. As for the time out issue still working that one. |
@fabolhak
I changed the subscriber sketch to print the message out using ReceivedDataStructure as in the example on the Subscriber tutorial on the UAVcan website. While I got the subscriber started and the sketch runs I can't seem to get the message read an printed using ReceivedDataStructure: here is new subscriber I am using:
Any suggestions would be appreciated. I am going to keep playing with it just in case I missed something.
BTW: only spinOnce works if I try and use something in the form of
const int res = node.spin(uavcan::MonotonicDuration::getInfinite());
it gives me an error code of 4.Thanks
Mike
The text was updated successfully, but these errors were encountered: