Skip to content

Kilted: log!() macros do not publish to "/rosout" topic #590

@EmeraldWither

Description

@EmeraldWither

Hello!

When using

log!(node.error(), "This is a log message");

it is expected that a message will be published to the /rosout topic with the message contents, however, this behavior does not appear to exist.

I confirmed it by running the minimal project below, while having $ ros topic echo /rosout active in another terminal session, alongside having another package subscribed to the /rosout topic, and verifying that nothing is published to /rosout on a log message.

Here is a minimal project that I setup to test this:

src/minimal_logger.rs

use anyhow::{Error, Result};
use rclrs::*;

fn main() -> Result<(), Error> {
    let context = Context::default_from_env()?;
    let mut executor = context.create_basic_executor();
    let node = executor.create_node("log_test_node")?;
    log!(node.error(), "This is a log message!");
    executor.spin(SpinOptions::default());
    Ok(())
}

cargo.toml

[package]
name = "minimal_pub_sub_rust"
version = "0.5.0"
edition = "2021"
[[bin]]
name = "minimal_logger"
path = "src/minimal_logger.rs"

[dependencies]
anyhow = {version = "1", features = ["backtrace"]}
rclrs = "0.7.0"

package.xml

<?xml version="1.0"?>
<?xml-model
   href="http://download.ros.org/schema/package_format3.xsd"
   schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>minimal_pub_sub_rust</name>
  <version>0.5.0</version>
  <description>Package</description>
  <license>Apache License 2.0</license>
  <maintainer email="[email protected]">EmeraldWither</maintainer>

  <build_depend>rclrs</build_depend>
  <exec_depend>rclrs</exec_depend>

  <export>
    <build_type>ament_cargo</build_type>
  </export>
</package>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions