Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GZ topics inherit ROS namesapce
Browse files Browse the repository at this point in the history
Signed-off-by: Kotochleb <[email protected]>
Kotochleb committed Mar 18, 2024

Verified

This commit was signed with the committer’s verified signature.
Kotochleb Krzysztof Wojciechowski
1 parent 13e5592 commit c727652
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ros_gz_bridge/src/ros_gz_bridge.cpp
Original file line number Diff line number Diff line change
@@ -43,9 +43,13 @@ void RosGzBridge::spin()
if (handles_.empty()) {
std::string config_file;
this->get_parameter("config_file", config_file);
const std::string ros_ns = this->get_namespace();
if (!config_file.empty()) {
auto entries = readFromYamlFile(config_file);
for (const auto & entry : entries) {
for (auto & entry : entries) {
if (entry.gz_topic_name[0] != '/' && ros_ns.length() > 1) {
entry.gz_topic_name = ros_ns + '/' + entry.gz_topic_name;
}
this->add_bridge(entry);
}
}
@@ -55,7 +59,6 @@ void RosGzBridge::spin()
bridge->Spin();
}
}

void RosGzBridge::add_bridge(const BridgeConfig & config)
{
bool gz_to_ros = false;

0 comments on commit c727652

Please sign in to comment.