Skip to content

Commit

Permalink
Add output messages
Browse files Browse the repository at this point in the history
  • Loading branch information
IsabelParedes committed Sep 8, 2023
1 parent 668e6db commit 59e5831
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ws-build/rclwasm/rcl_publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,12 @@ function dbg(text) {
}},default_tty1_ops:{put_char:function(tty, val) {
if (val === null || val === 10) {
err(UTF8ArrayToString(tty.output, 0));
// NOTE: Added for better messages
self.postMessage({
command: "console",
role: "rclpub",
message: UTF8ArrayToString(tty.output, 0)
});
tty.output = [];
} else {
if (val != 0) tty.output.push(val);
Expand Down
6 changes: 6 additions & 0 deletions ws-build/rclwasm/rcl_subscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,12 @@ function dbg(text) {
}},default_tty1_ops:{put_char:function(tty, val) {
if (val === null || val === 10) {
err(UTF8ArrayToString(tty.output, 0));
// NOTE: Added for better messages
self.postMessage({
command: "console",
role: "rclsub",
message: UTF8ArrayToString(tty.output, 0)
});
tty.output = [];
} else {
if (val != 0) tty.output.push(val);
Expand Down

0 comments on commit 59e5831

Please sign in to comment.