src/nodes/src/environment.cpp
// Waits for the Environment node to return a message
Waits for the Environment node to return a message
Waits for the Environment node to return a message
void Environment::callback(const std_msgs::String::ConstPtr& message) {
        std::string data = message->data.c_str();
        if(data == "spawn") {
            deleteEverything(model);
            spawnEverything(model);
            data = "spawned";
        } else if(data == "delete") {
            deleteEverything(model);
            data = "deleted";
        } else {
            data = "failed";
        }
        publishData(data);
    }
void Environment :: callback ( const std_msgs :: String :: ConstPtr & message ) { std :: string data = message -> data . c_str ( ) ; if ( data == " " ) { deleteEverything ( model ) ; spawnEverything ( model ) ; data = " " ; } else if ( data == " " ) { deleteEverything ( model ) ; data = " " ; } else { data = " " ; } publishData ( data ) ; }
Waits for the Environment node to return a message
Waits for the Environment node to return a message