Question: Write the following codes in c + + Programming language please. Note 1 : Only standard C + + libraries are used. Note 2 :

Write the following codes in c++ Programming language please.
Note1: Only standard C++ libraries are used.
Note2: Create two classes as given in uml diagram picture each class should have
heade(className.h), a cpp file(className.cpp) and a test program for each class.
Note3: The class Names are NaoRobotAPI and forceSansor as given in the uml diagram.
Class NaoRobotAPI: This class allows you to use and work with the simulator.
It is given so that you can develop the programs. Changing when you do not have the source code .cpp
you have no chance. However, what the member functions you will use do and the parameters they require
descriptions can be found in the NaoRobotAPI.h file.
Note4: The description for Class NaoRobotAPI is given at below.
Class ForceSensor: The robot has four force sensors under each foot sole. this sensor
The force calculated by using the values is taken as the force applied by the robot to the ground. this sensor
Provides data retention and management.
updateSensor(force): Loads the current sensor value of the robot into the force variable.
getForce(): Returns the force information of the sensor.
checkFall(): The force value measured while the robot is standing, when the robot falls to the ground, its base touches the ground.
Since it will not, it will decrease by a significant amount. Based on this, true if the robot is detected to fall, otherwise
will return false.
Note5: Class ForceSensor: Also should has a headerfile(className.h),a cpp file
(className.cpp) and a test class.
Note 6: NaoRobotAPI.h description and uml diagram is given at below.
class NaoRobotAPI{
public:
// Constructor
NaoRobotAPI();
// Connects to the simulated robot and makes initializations
void connect();
// Close the connection to the simulated robot
void disconnect();
//The robot moves a few steps
//Move directions can be {FORWARD, BACKWARD, LEFT, RIGHT}
void moveRobot(DIRECTION);
// The robot turns
// Move directions can be {LEFT, RIGHT}
void turnRobot(DIRECTION);
// The robot stops
void stopRobot();
// Returns the sonar range values which are located on the chest of the robot
// in meters
void getSonarRange(double &left, double &right);
// Returns the position of the robot on x-axis in meters
double getX();
// Returns the position of the robot on y-axis int meters
double getY();
// Returns the orientation of the robot about z-axis in degrees
double getTh();
// On the front of the foot of the robots, there are four bumper sensors
// False if no touch, true if foot touch to an obstacle.
void getFootBumpers(bool& leftFoot_left, bool& leftFoot_right,
bool& rightFoot_left, bool& rightFoot_right);
//Returns the total force at the bottom of the foot in Kgf.
double getFootForce();
};
#endif //!NAOROBOTAPI_H
NaoRobotAPI
+connect() : void
disconnect() : void
+moveRobot(dir : DIRECTION) : void
+stopRobot() : void
+tumRobot(dir : DIRECTION) : void
+getSonarRange(left : double&, right : double& ) : void
getX() : double
getY() : double
getTh : double
+getFootBumpers (leftFoot_left : bool&, leftFoot_right : bool&, rightFoot_left : bool&, rightFoot_right : bool& ) : void
+getFootForce() : double
Note: Please write correct codes and make sure that codes are working.
 Write the following codes in c++ Programming language please. Note1: Only

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!