Does anyone have tips/examples getting a rosserial_windows publisher in a class?
I can get things working in main and/or using global functions but can't seem to get things working as a member of a class. I am not sure how to initialize the member variables for NodeHandle and Publisher and not totally who should be calling spin (i.e., the class via some callback or the parent function/class that owns the class with said publisher). This particular stack seems dangerous with respect to assumptions regarding ros APIs (vs their native counterparts).
Thanks, Brett
There shouldn't be too much difference between all the variants you describe.
Can you perhaps show some MWE that doesn't work, and something that does?
I'm not sure what you mean by that:
rosserial
has always been different wrt control flow compared toroscpp
.I have never used it before... Regardless, some design choices seem lacking... lots of c strings and passing by pointers with seemingly shallow copies. Understandable I guess for some of the ports but Windows has much better options.
One problem I figured out was that I was getting segfaults as my variables I used to initialize everything went out of scope. Additionally the socket would close if I didn't spin frequently enough.
As I was initializing other hardware after ros::NodeHandle::initNode() I would get error messages on the next spin call if I took more than a second or two max... these are all hard things to catch and not obvious or documented...
rosserial_windows
is an almost direct port ofrosserial
for the embedded and microcontroller platforms. That's where all the raw pointers, c strings and other "strangeness" comes from.I guess people either accept it or use
rosbridge_suite
or the recent Windows 10 port.Can you comment on any significnat performances between
rosserial
androsbridge_suite
?Protocols are rather different, so I'm not sure I can.
rosserial
is typically used with low-end hw, whilerosbridge_suite
is typically used for low-bandwidth integration of higher-level applications (ie: UIs, web-apps).If you can say something about what sort of integration you're ..