Basic Sanity Tests To Verify Core Operation
This page tells how to verify basic operation of the Magni robot. If you have Magni Silver then the robot will have a few blue LEDs on top that will be helpful but not required to do these tests.
Wifi HotSpot Verification
If no LAN cable is attached and if the robot has not been configured to look for a WiFi OR if no WiFi can be seen then the Magni software will create a HotSpot that you can connect to with your laptop.
If you have Magni Silver with the Sonar board then as the robot is powered up the LED2 (right LED on Sonar board as seen from the front) will light with dim blue light. After 6 or so seconds that LED will turn off. After about 16 or so seconds if WiFi is able to come up LED2 will start to blink brightly about once per second indicating that the WiFi HotSpot is up. At this time if you have on your smartphone some sort of WiFi network scanner you will see a ubiquityrobotics WiFi with last 4 digits being a unique hex value.
You will also see this HotSpot show up on your laptop and will be able to connect. Read HERE for more.
Basic Movement Tests:
The first Test is a Firmware Only test: With no WiFi connected, have the red ‘ESTOP’ switch in the ‘out’ position and the black main power switch pushed in so the Magni is totally off. Then push the black main power switch which will turn on main power. At this point the main power switch will be in the ‘out’ position.
RESULT: No jump in motors and motors are in the locked state strongly resisting movement.
- Edit ROS log with
and verify that the last ‘Firmware version’ line in the log is the expected firmware version.
Wait for motor node to be fully started which takes 20 seconds or so sometimes.
RESULT: Wheels PID locked still and no jump in movements.
Distance and Low Speed Movement Tests:
Enter keyboard movement using:
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
Press the ‘z’ key 6 times till the ‘speed’ value shows about 0.26 meters per second. Press the ‘c’ key 6 times till the ‘turn’ value shows about 0.53
At this point the robot will not move because when teleop is first entered it is in same state as if the ‘k’ was hit.
Also as setup have a second window open and in that type:
rosrun tf tf_echo odom base_link
which will continue to update. Now we will do a few tests and make sure the robot can move forward 1 meter and could have room to rotate fully.
In the teleop window press the i letter repeatedly every half second for 5 seconds. This should move the Magni about 1 meter forward.
Look at the ‘Translation’ line in the second tf window and the first of the 3 numbers is X and should be near 1.0 (or near it if not exactly 1 meter).
In the teleop window press the ‘,’ (comma) key repeatedly every half second for 5 seconds. This should move the Magni about 1 meter straight back to where it started.
Look at the ‘Translation’ line in the second tf window and the first of the 3 numbers is X and should have returned to near 0.0.
Next press the j key so the Magni rotates 90 degrees to face left. The tf window Rotation for line in (degree) should have 3rd number near 90 for 90 degrees to the left. If it goes too far you can use quick taps to the l key to inch it back to about 90.
Press the l letter key and the Magni will rotate clockwise and in about 6 seconds will be around 90 degrees to the right. The Rotation in RPY (degrees) third number should now be near -90 degrees IF the Magni is facing direct left. Again, quick taps on j and l can do smaller rotations.
RaspiCam Camera Test:
There is a very simple way to test the RaspiCam camera on the robot. This test will generate a jpeg still picture in about 6 seconds just to check the camera functionality.
raspistill -o testpicture.jpg
To verify the camera is operating properly the testpicture.jpg file needs to be moved to your laptop or other computer that has a jpeg picture viewer. If it is too difficult to move the picture using ftp or some other linux operation, the next best thing is to look at the file size. This can be done in the line below and the reply shows the 1543213 as the size in bytes for the jpeg image file.
ls -l testpicture.jpg
-rw-rw-r-- 1 ubuntu ubuntu 1543213 Aug 4 08:18 testpicture.jpg
(Assumes rev 5.0 or later board. If not exception will be noted)
- For any rev 5.0 board and current code the ROS topic /motor_power_active indicates if power is on or off. The topic is not instantaneous in response and can take a couple seconds. Note that ESTOP active means motor power off.
Press in to engage ESTOP with 0 cmd_vel OR non-zero cmd_vel. (keep ESTOP pressed)
RESULT: Wheels have slight resistance when ESTOP is active
Release ESTOP having not moved the motors and motor node is on
RESULT: Wheels return to locked, stopped state with none or only a tiny amount of movement noticed
Press ESTOP again and this time move the wheel a half revolution (there is resistance but it moves). Release ESTOP
RESULT: For rev 5.0 board no wheel ‘lurch’ happens and motors return to locked state with tiny or no movement. RESULT: For rev 4.9 board the wheel will snap back quickly the half turn then lock. This cannot be avoided.
Run the joystick or use ‘twist’ to make motors actively move (perhaps on blocks not on ground). Press ESTOP to active state
RESULT: Motors will no longer have power and will slow to a stop with mild ‘self braking’ resistance to movement.
Continue to run the joystick for a couple seconds then release the joystick and then release ESTOP a second later to power motors.
RESULT: Rev 5.0 board will power up the wheels and there will be tiny or no movement as wheels return to locked stopped state
RESULT: This test is not recommended for rev 4.9 boards as ESTOP switch could not be read so large movements can happen.
As before run the joystick with motors running then hold joystick active and press ESTOP (wheels stop). Release ESTOP in 3 sec
RESULT: Even though joystick was active all the time, on release of ESTOP after a half second or so wheels nicely ramp to speed again.
Max Speed Limit Test:
Here we look to verify the max speed limit value will cause the robot to not exceed the default 1 meter per second setting. We will again use teleop_twist_keyboard so just keep it active OR start it like this if not running yet
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
Place the robot on ‘blocks’ for the front wheel so the drive wheels do not touch the floor. Normally we put a block of wood or a small stack of books under the front of the robot and it raises it up so the wheels do not touch the floor. Put a piece of tape on the outside of a wheel so while testing we can count revolutions to get the actual speed.
YOU MUST HAVE THE ROBOT DRIVE WHEELS ELEVATED TO NOT TOUCH THE GROUND FOR THIS TEST!
In the teleop window press the k key once to be in “stop” mode then press the z key several times until the “speed” value shows a value just under 1.0 meters per second. If you go too far the , (comma) key backs the speed value down.
In the teleop window press the i key repeatedly at a fast rate (3 or 4 times a second) and the wheels spin.
Verify the speed is going at 1 meter per second by watching the wheels turn 10 times in about 14 seconds. The wheels have a circumference of just near 0.64 meters. This is not a scientific test, it is looking for things being far off of the expected speed.
Deadman Timer Testing:
The robot is designed to return to zero speed if it loses touch with constant host velocity commands.
Startup and run the robot on blocks at a constant speed. Kill the motor node OR disconnect serial (if your system allows). The motor node can be stopped and starting using:
sudo systemctl stop magni-base.service
RESULT: The robot will return to stopped state with wheels actively locked.
- Start or re-connect serial to the motor node using
sudo systemctl start magni-base.service
RESULT: Robot should be operational after the motor node starts (takes 15 or more seconds to start).
For re-connect of serial it will start back up in a second or less.