# State UML Diagram

• November 18th, 2012, 09:34 AM
calebite207
State UML Diagram
I have no idea how to solve this problem and having seen this forum outstanding performances in resolving problems presented by other users in the past, I considered it an avenue to get help and also learn. I believe you'll help me and put me through how to go about this and solve similar problems in the near future. My question is as follows:
Consider a walking robot that has two legs and two arms. The robot walks towards a screen that has three buttons (red, yellow, and green). On the path towards the screen, there is a chair that blocks the robot. The robot observes the chair and make a left turn of 80 degree, walk 20 cm and make right turn of 100 degree walk forward (to the screen). To reach the correct position, after 40 cm, additional adjustment of 100 degree to the right is needed. After 15 cm, robot makes left turn of 160 degree towards the screen and finally reaches it. The robot lifts left arm and uses color sensor to detect the color on the screen, put down the left arm and lift right arm to press button based on the detected color of the button. Now, I'll like to prepare a state diagram of the above scenario using correct UML notations.
Please kindly assist me and put me through.
Thanks.
• November 18th, 2012, 11:11 AM
curmudgeon
Re: State UML Diagram
You will want to decompose the problem into its smaller parts. What classes (nouns) will Robot possibly have? Think of the physical attributes that make up this Robot. What behaviors (verbs) will these attributes (or nouns) need? These will be the methods of the classes. This should be the starting basis of your class descriptions and eventually UML diagram.
• November 18th, 2012, 12:30 PM
C++kingKnowledge
Re: State UML Diagram
what do u think your main class of moving a robot would be called? what instructions should be given to that class (these would be helper the classes on the diagram).... should the degree rotation and movement instructions be in the same class or should they be separate? how would you instruct the robot to detect if an object is blocking its path or not? all of this should be considered when mapping out your diagram