diff --git a/launch/cell-sync/dummy_rag_connector_b_robot_1.launch b/launch/cell-sync/dummy_rag_connector_b_robot_1.launch new file mode 100644 index 0000000000000000000000000000000000000000..29671f59de6b09219de77c41d29cf4935fb1aec6 --- /dev/null +++ b/launch/cell-sync/dummy_rag_connector_b_robot_1.launch @@ -0,0 +1,7 @@ +<launch> + + <node pkg="ccf" type="dummy_rag_connector_b" name="dummy_rag_connector_b_1" output="screen"> + <rosparam param="/ccf/place_b_prefix">place-b-1</rosparam> + </node> + +</launch> diff --git a/launch/cell-sync/dummy_rag_connector_b_robot_2.launch b/launch/cell-sync/dummy_rag_connector_b_robot_2.launch new file mode 100644 index 0000000000000000000000000000000000000000..59bd68c60f511bca7a1fe74fdf0bd29f64fe09fa --- /dev/null +++ b/launch/cell-sync/dummy_rag_connector_b_robot_2.launch @@ -0,0 +1,7 @@ +<launch> + + <node pkg="ccf" type="dummy_rag_connector_b" name="dummy_rag_connector_b_2" output="screen"> + <rosparam param="/ccf/place_b_prefix">place-b-2</rosparam> + </node> + +</launch> diff --git a/src/dummy_rag_controller_b.cpp b/src/dummy_rag_controller_b.cpp index 8fe25f58654a3ffd6baed391b06399081e4b07db..6a2a6ef8b32496e15fd118f9bc387bd5633424b5 100644 --- a/src/dummy_rag_controller_b.cpp +++ b/src/dummy_rag_controller_b.cpp @@ -38,7 +38,10 @@ int main(int argc, char **argv) { std::string cgv_address = getParameter(n, "cgv_address", "tcp://*:6576"); + std::string cell_prefix = getParameter(n, "place_b_prefix", CELL_NAME); + DummyRobotArmController connector{n, CELL_NAME}; + connector.setSendSceneTopic(cell_prefix + "/scene"); // only for debugging (uncomment when running without the RAG part) // connector.loadScene("/home/jm/work/git/ceti/models2021/src/ccf/config/config_pick_place_scene.json"); @@ -46,8 +49,8 @@ int main(int argc, char **argv) { // add an MQTT connection std::string mqtt_address = getParameter(n, "mqtt/mqtt_address", "tcp://localhost:1883"); std::unique_ptr<MqttConnection> mqtt_connection = std::make_unique<MqttConnection>(mqtt_address, NODE_NAME); - mqtt_connection->addTopic(CELL_NAME + "/scene/init"); - mqtt_connection->addTopic(CELL_NAME + "/command"); + mqtt_connection->addTopic(connector.getInitSceneTopic()); + mqtt_connection->addTopic(connector.getCommandTopic()); connector.addConnection(std::move(mqtt_connection)); ros::Subscriber sub = n.subscribe<std_msgs::Empty>("send_scene", 1000, @@ -104,7 +107,7 @@ int main(int argc, char **argv) { }; connector.reactToPickAndPlaceMessage(pickPlaceLambda); - std::string reachabilityTopicPrefix = CELL_NAME + "/reachability/"; + std::string reachabilityTopicPrefix = cell_prefix + "/reachability/"; auto sceneUpdateLambda = [&reachabilityTopicPrefix, &connector]() { ROS_INFO_STREAM("[" << NODE_NAME << "] Scene was updated, sending new reachability information."); @@ -136,4 +139,4 @@ int main(int argc, char **argv) { ros::spin(); return 0; -} \ No newline at end of file +}