mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 17:49:33 +00:00
Use model name as topics namespace in simulation
This commit is contained in:
parent
a9bcec2fa5
commit
415f0e9ad5
@ -205,11 +205,12 @@ public:
|
||||
|
||||
void initNode() {
|
||||
nodeHandle = transport::NodePtr(new transport::Node());
|
||||
nodeHandle->Init(); // TODO: namespace
|
||||
motorPub[0] = nodeHandle->Advertise<msgs::Int>("~/motor0");
|
||||
motorPub[1] = nodeHandle->Advertise<msgs::Int>("~/motor1");
|
||||
motorPub[2] = nodeHandle->Advertise<msgs::Int>("~/motor2");
|
||||
motorPub[3] = nodeHandle->Advertise<msgs::Int>("~/motor3");
|
||||
nodeHandle->Init();
|
||||
string ns = "~/" + model->GetName();
|
||||
motorPub[0] = nodeHandle->Advertise<msgs::Int>(ns + "/motor0");
|
||||
motorPub[1] = nodeHandle->Advertise<msgs::Int>(ns + "/motor1");
|
||||
motorPub[2] = nodeHandle->Advertise<msgs::Int>(ns + "/motor2");
|
||||
motorPub[3] = nodeHandle->Advertise<msgs::Int>(ns + "/motor3");
|
||||
}
|
||||
|
||||
void publishTopics() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user