src/nodes/src/test_controller_camera.cpp
// Waits for the Camera node to return a message
Waits for the Camera node to return a message
Waits for the Camera node to return a message
void Camera::callback(const std_msgs::String::ConstPtr& message) {
        std::string data = message->data.c_str();
        ros::Duration(2).sleep();
        srand (time(NULL));
        int xCoord = rand() % 500;
        ros::Duration(1).sleep();
        srand (time(NULL));
        int yCoord = rand() % 500;
        std::stringstream ss;
        ss << xCoord << " " << yCoord;
        data = ss.str();
        publishData(data);
    }
void Camera :: callback ( const std_msgs :: String :: ConstPtr & message ) { std :: string data = message -> data . c_str ( ) ; ros :: Duration ( 2 ) . sleep ( ) ; srand ( time ( NULL ) ) ; int xCoord = rand ( ) % 500 ; ros :: Duration ( 1 ) . sleep ( ) ; srand ( time ( NULL ) ) ; int yCoord = rand ( ) % 500 ; std :: stringstream ss ; ss << xCoord << " " << yCoord ; data = ss . str ( ) ; publishData ( data ) ; }
Waits for the Camera node to return a message
Waits for the Camera node to return a message