コード例 #1
0
int main(int argc, char** argv) {
  //initialize the node
  ros::init(argc, argv, "message_delivery");

  ros::NodeHandle privateNode("~");

  privateNode.param<std::string>("location",location, /*default*/ ""); 
  privateNode.param<std::string>("message",message,"");
  privateNode.param<int32_t>("speed",speed,160);
  privateNode.param<std::string>("voice",voice,"default");
  privateNode.param<int32_t>("pitch",pitch,50);

  if (location.compare("") != 0) {
    goToLocation();
    deliverMessage();
  }
}
コード例 #2
0
/**
 * Request robot to move back to its home location
 */
void MedicationRobot::goToHome(const std_msgs::Empty) {
    goToLocation(homePoi.getLocation());
    currentLocationState = GOING_HOME;
}
コード例 #3
0
/**
 * Request robot to start moving towards the Resident
 */
void MedicationRobot::goToResident(const std_msgs::Empty) {
    ROS_INFO("MedicationRobot: Going to %f, %f", residentPoi.getLocation().x, residentPoi.getLocation().y);
    goToLocation(residentPoi.getLocation(), true);
    currentLocationState = GOING_TO_RESIDENT;
}