Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This robot has to perform the following path: move forward 40 centimetres; turn 90 degrees clockwise; move backwards for 10 seconds; move in a square

This robot has to perform the following path: move forward 40 centimetres; turn 90 degrees clockwise; move backwards for 10 seconds; move in a square spiral assuming each move being linear, (i.e. the robot moves around a tile square of two feet the side); stop movement.

You will have to build a UML state machine that models the behaviour described above, using only the sub-set of UML state machine specifications shown in Background material shown at the Appendix of this Assignment.

  • The robot is initially stopped and it will only start moving when a button located on it is pressed.
  • An external timer is available, so UML timeout events can be used.
  • The following functions are implemented:
    • move_forward() Robot will start moving forward.
    • move_backwards() Robot will start moving backwards.
    • turn_cw() Robot will turn 90 degrees clockwise.
    • stop() Robot will cease movement.
  • These three functions will return as soon as the signal to the motors is sent.
  • There is a counter that measures the distance traveled (in centimetres), regardless of direction. Whenever the movement starts, this counter is reset. Whenever the value of this counter reaches 20, the counter is reset and an interrupt is generated.
  • Once the robot has executed the path, it stops and pushing the button will not restart the path. In order to restart the path, the robot will have to be power-cycled.

In order to build the requested UML state machine, perform the following steps:

a) Define and list all necessary UML events that will generate transitions between states of the UML state machine. For each event, specify the UML event type (i.e. signal, call event, timeout event).

b) Build a list of states for the UML state machine. List all the states in the following manner: for each state, specify its name; the event that generates the transition out of the state; the guard condition (variable), if applicable, that must be observed for the transition to take place; and the name of the next state (i.e. the state that the system transitions into as a result of the transition). If more than one transition exists out of a given state, list all possible transitions out of that state. Use the following as a guideline when listing the states:

State name: ...

Transition #1

Generating event: ...

Guard condition: ...

Next state: ...

Transition #2

...

c) Draw the resulting UML state machine. Draw separately the UML definition for any signal used in the state machine.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions