roslibjs icon indicating copy to clipboard operation
roslibjs copied to clipboard

roslibjs logging functions missing?

Open joshua-glazer opened this issue 5 years ago • 8 comments

My team was looking into how to use ROS logging (loginfo, logerr, logwarn) in roslibjs for our project but it doesn't look like this functionality exists right now. If it does exist, how can I use it? Otherwise, I think it would be good to have.

joshua-glazer avatar Feb 07 '20 04:02 joshua-glazer

On the browser side, I always use console.log because that is very well integrated in the chrome debugger (viewing/filtering)

If you want, you could create a publisher to the rosout topic.

Rayman avatar Feb 10 '20 10:02 Rayman

I suppose that works, but to correctly publish to /rosout I would need to generate the seq, header and other data in the message.

joshua-glazer avatar Feb 10 '20 19:02 joshua-glazer

I've made significant progress in writing functions to behave like the rospy log functions. Some things are still missing but I'm hoping to make a PR with my code at some point.

joshua-glazer avatar Feb 15 '20 08:02 joshua-glazer

@vashmata still planning to open a PR with logging functions?

MatthijsBurgh avatar Jun 13 '21 11:06 MatthijsBurgh

@vashmata still planning to open a PR with logging functions?

Thanks for the reminder @MatthijsBurgh, last year I actually did finish the basic functionalities on our end. I'd like to make a PR, but where do I put the code? It's a script that has to be loaded after the ROSLIB.ros() object is created and ROS connection has been established. Not sure where in your file/folder structure it belongs. I created a little example webpage with buttons that demos the functionality too.

joshua-glazer avatar Jun 13 '21 20:06 joshua-glazer

You can take a look at Logging.html and ros_log.js over here to get an idea: https://github.com/vashmata/roslibjs/tree/ros_logging/examples

joshua-glazer avatar Jun 13 '21 20:06 joshua-glazer

Made a PR to get some eyes on it, but the CI test for noetic failed, not sure why. Here's the error that I think is causing the failure:

Firefox 95.0 (Ubuntu 0.0.0) TF2 Republisher Example tf republisher FAILED
	Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

I don't know what this has to do with my changes, firstly because it's referencing an example (tf2 republisher) I didn't touch, and secondly because I'm not super familiar with async and whatnot and I don't think I even used that in my files.

joshua-glazer avatar Jan 13 '22 13:01 joshua-glazer

@vashmata I trigger a re-run of the CI. Let's see what happens.

MatthijsBurgh avatar Jan 13 '22 14:01 MatthijsBurgh