Commit c5d72abc authored by Dominique Piche's avatar Dominique Piche

add user guide

parent 678578a5
......@@ -15,6 +15,6 @@ robot.run('MoveLinRelTRF', [0,-100,0,0,0,0])
robot.run('MoveLinRelTRF', [0,0,-100,0,0,0])
robot.run('MoveLinRelTRF', [0,50,0,0,0,0])
robot.wait_for('3012', 'Did not receive EOB')
robot.wait_for('3012')
robot.deactivate()
\ No newline at end of file
......@@ -13,6 +13,6 @@ robot.run('MoveLinRelTRF', [0,0,0,90,0,0])
robot.run('MoveLinRelTRF', [0,0,0,-180,0,0])
robot.run('MoveLinRelTRF', [0,0,0,90,0,0])
robot.wait_for('3012', 'Did not receive EOB')
robot.wait_for('3012')
robot.deactivate()
\ No newline at end of file
......@@ -13,6 +13,6 @@ robot.run('MoveLinRelWRF', [0,0,0,0,0,60])
robot.run('MoveLinRelWRF', [0,0,0,0,0,-120])
robot.run('MoveLinRelWRF', [0,0,0,0,0,60])
robot.wait_for('3012', 'Did not receive EOB')
robot.wait_for('3012')
robot.deactivate()
\ No newline at end of file
......@@ -13,7 +13,7 @@ robot.run('MovePose', [200,0,200,0,0,0])
robot.linear_sequence(direction_vector=np.array([1,0,0]), total_distance=100, step=5, delay=0.1)
robot.wait_for('3012', 'Did not receive EOB')
robot.wait_for('3012')
robot.stop_tracking()
robot.deactivate()
\ No newline at end of file
......@@ -17,7 +17,7 @@ robot.linear_sequence(direction_vector=np.array([1,0,0]), total_distance=50, ste
robot.run('Delay', 1)
robot.move_position_relative_to_source(np.array([-60,0,0]))
robot.wait_for('3012', 'Did not receive EOB')
robot.wait_for('3012')
robot.stop_tracking()
robot.deactivate()
\ No newline at end of file
......@@ -16,7 +16,7 @@ robot.turn_around_source(angle_to_cover=180, angular_step=-15, delay=0.1)
robot.run('Delay', 1)
robot.wait_for('3012', 'Did not receive EOB')
robot.wait_for('3012')
robot.stop_tracking()
robot.deactivate()
\ No newline at end of file
......@@ -14,33 +14,13 @@ The MecaRobotForDosimetry adapts the MecaRobot class for scintillation dosimetry
The robot allows for a simulation mode, in which the actual robot does not move but we can still see the animation on the web interface. It is possible to add a 3D model of the tool fixed at the end of the robot so we can see it on the simulation (here the mPSD_holder.stl), as well as a 3D model of the environnement (here to source_catheter_holder.stl).
## Usage
The robot takes a set of proprietary commands, which can be found [here](https://mecademic.com/Documentation/Meca500-R3-Programming-Manual.pdf).
The following codes instantiates a MecaRobot object, moves it to form a square, and disables it.
from MecaRobot.meca_robot import MecaRobot
robot = MecaRobot()
robot.run('MovePose',[200,0,150,0,90,0])
robot.run('MoveLinRelTRF',[0,-50,0,0,0,0])
robot.run('MoveLinRelTRF',[-100,0,0,0,0,0])
robot.run('MoveLinRelTRF',[0,100,0,0,0,0])
robot.run('MoveLinRelTRF',[100,0,0,0,0,0])
robot.run('MoveLinRelTRF',[0,-50,0,0,0,0])
robot.wait_for('3012', 'Did not receive EOB')
robot.deactivate()
The result is shown [here](https://www.youtube.com/watch?v=oYra652iN-g). Once a MecaRobot object is instanciated, the robot is enabled, homed and sent to its initial position. The run method takes a proprietary command with its arguments (which can be either a digit or a list) and sends it to the robot. For instance, the MovePose commands moves the robot to the position (x,y,z,α,β,γ) in relation to the base of the robot, where α, β and γ are Euler angles following the mobile xyz convention. Similarly, the MoveLinRelTRF command moves the robot relative to its current position. The wait_for method allows to wait for a specific response from the robot before continuing the program. Here, we wait for an End of block response (EOB), which the robot sends when all of the movements commands have been executed. This is to make sure that the program is complete before we deactivate the robot. The deactivate command sends the robot back to its initial position before closing the connection.
The demo.py code shows a use of the MecaRobotForDosimetry class. The result is shown [here](https://youtu.be/T6YLrUir5cE).
## User guide
The user guide (user_guide.md) can be used as a quick way to get started using the Meca500 robot and the MecaRobot Python module.
## Documentation
The complete documentation can be found in the documentation.md file.
The complete Meca500 user guide written by the manufacturer can be found [here](https://www.mecademic.com/Documentation/Meca500-R3-User-Manual.pdf) and [here](https://www.mecademic.com/Documentation/Meca500-R3-Programming-Manual.pdf).
<!--stackedit_data:
eyJoaXN0b3J5IjpbLTYzMjgyNzRdfQ==
-->
\ No newline at end of file
The complete documentation for this Python module can be found in the documentation.md file.
\ No newline at end of file
......@@ -44,7 +44,7 @@ Prints a response from the robot, which are sent after every request commands. T
Clears the socket buffer, in which the unread responses from the robot are stocked. This can be used before a request command to ensure that the response we get actually is from this request command (i.e. not from an earlier command).
**MecaRobot.wait_for**(*answer, error_message, timeout=10*)
**MecaRobot.wait_for**(*answer, error_message='Did not receive the expected robot answer.', timeout=10*)
Waits for a specific answer from the robot before continuing the program. For instance, we might want to wait for the robot to stop moving before running the request command GetPose (which returns the robot position and orientation). Since the robot sends a *[3004][End of movement.]* response when it stops moving, using wait_for('3004', 'Did not receive EOM') will halt the program until the robot has stopped moving. If the answer if not found after timeout, the error_message if printed.
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment