A smart real-time anti-overturning mechatronic device for articulated robotic systems operating on side slopes