Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add robotNamespace to DetachableJoint plugin #2409

Open
Janphr opened this issue May 15, 2024 · 1 comment
Open

Add robotNamespace to DetachableJoint plugin #2409

Janphr opened this issue May 15, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Janphr
Copy link

Janphr commented May 15, 2024

Problem description

Spawning multiple models with DetachableJoint plugin will result in only one shared detach topic.
Consider using robotNamespace like here:

std::string topic = transport::TopicUtils::AsValidTopic(

for all plugins.

Implementation suggestion

    std::string robotNamespace = this->model.Name(_ecm);
    if (_sdf->HasElement("robotNamespace")) {
        robotNamespace = _sdf->Get<std::string>("robotNamespace");
    }

    // Setup detach topic
    std::vector<std::string> detachTopics;
    if (_sdf->HasElement("detach_topic")) {
        detachTopics.push_back(transport::TopicUtils::AsValidTopic(
            robotNamespace + "/" + _sdf->Get<std::string>("detach_topic")));
    } else {
        detachTopics.push_back("/model/" + this->model.Name(_ecm) +
                               "/detachable_joint/detach");
    }

same for attach and state

@Janphr Janphr added the enhancement New feature or request label May 15, 2024
@arjo129 arjo129 self-assigned this May 24, 2024
@arjo129
Copy link
Contributor

arjo129 commented May 24, 2024

Distantly related: #1097

We should probably refactor this plugin a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Inbox
Development

No branches or pull requests

2 participants