From 01e7902c1f9b4657de602f2a50be04b2078f20b1 Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Sun, 19 Apr 2020 19:40:57 -0400 Subject: [PATCH] Test Insert Object Quit Option - Add option to stop test insert object - Remove comments from model_insertion_plugin.cpp - Update home.md to specify root user when attaching a new terminal --- docs/home.md | 2 +- rrrobot_ws/src/rrrobot/src/model_insertion_plugin.cpp | 6 +----- rrrobot_ws/src/rrrobot/test/test_insert_object.cpp | 7 ++++++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/home.md b/docs/home.md index fe3991b..b831a4d 100644 --- a/docs/home.md +++ b/docs/home.md @@ -130,4 +130,4 @@ Instructions for working in the GEAR Simulation can be found on the [GEAR](gear. - See running containers - `docker ps` - Attach a new terminal to a running container - - `docker exec -it bash` + - `docker exec -it -u root bash` diff --git a/rrrobot_ws/src/rrrobot/src/model_insertion_plugin.cpp b/rrrobot_ws/src/rrrobot/src/model_insertion_plugin.cpp index 07b3768..a863b4f 100644 --- a/rrrobot_ws/src/rrrobot/src/model_insertion_plugin.cpp +++ b/rrrobot_ws/src/rrrobot/src/model_insertion_plugin.cpp @@ -20,9 +20,7 @@ public: { std::cout << "Loading model insertion plugin" << std::endl; - // Option 1: Insert model from file via function call. - // The filename must be in the GAZEBO_MODEL_PATH environment variable. - parent = _parent; //->InsertModelFile("model://box"); + parent = _parent; if (!ros::isInitialized()) { @@ -63,8 +61,6 @@ public: // Send the message factoryPub->Publish(to_pub); - - // parent->InsertModelFile(std::string("model://") + msg.data); } private: diff --git a/rrrobot_ws/src/rrrobot/test/test_insert_object.cpp b/rrrobot_ws/src/rrrobot/test/test_insert_object.cpp index 5ae50e2..559ce14 100644 --- a/rrrobot_ws/src/rrrobot/test/test_insert_object.cpp +++ b/rrrobot_ws/src/rrrobot/test/test_insert_object.cpp @@ -18,8 +18,13 @@ int main(int argc, char **argv) while (ros::ok()) { rrrobot::model_insertion msg; - cout << "Enter the model name: "; + cout << "Enter the model name (or 'q' to quit): "; cin >> msg.model_name; + + if (msg.model_name == "q") { + return 0; + } + cout << "Enter the pose: " << endl; cout << "x: "; cin >> msg.pose.position.x;