PhantomX Pincher
03 August 2021phantomx_pincher is a ROS software package, that allows to simulate a robot arm, the PhantomX Pincher, in the Gazebo simulation environment.
In this post I’ll show the development, the used tools and the results of this project.
The robot
The phantomx_pincher is a manipulator robot arm with 4 DOF (Degrees of Freedom). It’s a low cost robot with Dynamixel servomotors, used in the academics for the study of manipulator arms.
The 3D files used in this project are hosted in GrabCAD: next picture shows the real robot photo and a render image of the 3D files.
To visit the website of the 3D model, click here
URDF model
From the 3D files, the joints subsets are defined. Then, DAE files are generated as independent parts. For this robot, four subsets are defined:
- Shoulder: contains the control electronics and the first servomotor.
- UpperArm: the second servomotor that links with Shoulder and Lowerarm
- LowerArm
- Wrist: contains the Fingers actuator
- Fingers: the end of the manipulator, made up with two parts that moves linearly.
Every set is converted to a 3D file among a simplified version used as solid body for collisions. Using these 3D files, an URDF model is builded. An URDF is a file that uses XML syntax to define every component. In this model, every joint between any pair of links is defined together with the inertial properties of the real robot.
The URDF model is used in RViz and Gazebo applications for both, visualization and simulation with realistic physics.
RViz: joints visualization
RViz is a software for visualization of ROS topics, used as a geneal purpose GUI for different robots. For this project, RViz is used as a URDF robot model viewer. The next picture shows the visual model of the robot (left) and the collision model of the same robot (right). Note that the collision model has simpler geometries, but the visual model has a more detailed and realistic geometry.
RViz allows to manipulate the robot model, moving the joints that was defined for this robot, through a simple windows with sliders. The below picture shows this GUI and the PhantomX Pincher in a custom pose.
Gazebo: simulation with realistic physics
Gazebo is a robot simulation framework with realistic environments that also works with ROS. Gazebo uses the physics properties of the environment to simulate the real behavior of the arm. The next picture shows el robot model in Gazebo with the center of mass of every set. The showed pose corresponds to home robot pose: Gazebo simulates the Dynamixel actuators and every servomotor controller and puts the required torque to preserve arm in extended pose.
The collision model is used by Gazebo to determinate in which points the solid bodies collides with another body. This allows to the robot interact with closer parts, achieving a correct simulation of pick and place task or realistic hits with the ground (of course, we don’t want that to robot hits anything).
With Gazebo an scene with load and unload zones drawn in the ground was created. Small and lightweight pieces that can be grasped byt the robot arm were added. The next picture shows a part of the scene.
GUI in MATLAB
MATLAB is used to build a GUI (Graphical User Interface) that allows to use the robot, using predefined positions, load zones, unload zones and small parts created for Gazebo. MATLAB includes a plugin to link with ROS, for which the inverse kinematics can be resolved in MATLAB side and publish through ROS messages to the robot.
The GUI allows to visualize the robot pose, the joint values, set a operation mode (manual or automatic) and shows the streamed image of a virtual camera mounted in Gazebo. The next picture shows the GUI appearance.
Teleoperation experiment with ROS, AWS and Gazebo
The last objective of this project is to do a remote operation task with the simulated robot in Gazebo, sending commands from a remote PC. A VPN network is mounted, taking advantage of free services of AWS (Amazon Web Services). With this network, to PC are linked, one of them running the simulation and another running the MATLAB GUI. Although there are delays in the communication because the packages needs to pass first in the VPN node, teleoperation and visualization are possible with these solutions. To see a demo, see the Sample Videos section.
Sample videos
The next video shows a simple exercise with the PhantomX Pincher simulated in Gazebo. Pick and place tasks are made, sending commands to thr robot with a simple GUI.
The video below shows the Remote control of a PhantomX Pincher robot using Gazebo and MATLAB project. Simulation runs in a remote PC, meanwhile the control and visualization GUI runs in a local PC. Connection between the PCs is made through a VPN, using AWS.