For my robotics final project, our team designed and simulated a physical system for taking long-exposure photos using the UR5e and a custom end-effector. I worked hardware and software that allows user drawings, 2D SVG files, and 3D DXF files to be converted into UR5e movements that trace an image in both simulation and the real world. Long-exposure photos of the UR5e performing movements capture the traced images.
The first subsystem is a custom mechanical device designed to manipulate the color and position of four LEDs using finger-like joints. This device supports up to four unique presets with WRGB functionality, enabling dynamic light configurations. An attachment securely connects the device to the UR5E gripper, eliminating the need for permanent mounting on the robotic arm.
The second subsystem handles the motion planning for the UR5E robot arm. Users can select from three input options via the terminal: drawing, SVG, or DXF. Each option is processed by a dedicated Python script, which outputs an array of tuples (X, Y coordinates). These coordinates are then transposed into pose goals for the robot arm using a ROS script.
Base Design
The base consists of 2 components that fit together so that the robot arm is able to close it's gripper on the device.
The upper portion of the base includes the housing for the finger joints, servos, and wire harness that holds all electronics.
Finger Joint Design
The finger joints are tensioned by fishing wire with springs creating an upright neutral position.
As the servo pulls in the line, the finger joint bends inwards, creating movement that stays in position through tension of the spring.
Arduino Logic
The end effector is controlled by an arduino uno which controls the servo movements as well as the 4 RGBW LEDs.
The device holds up to 4 programmable buttons for different modes that the user can select. After a starting sequence, the robot will emit the pattern and movement desired and then scan again for the next user input.
Draw_to_system.py
This script creates a graphical user interface (GUI) using the Tkinter library, allowing users to draw lines on a canvas by clicking points. The LineDrawer class initializes a 500x500 pixel canvas with a white background and a normalized coordinate system (x: -0.4 to 0.4, y: 0.2 to 1.0) for compatibility with ROS scripts.
Key Features:
• Point Marking: Users click to add points, which are displayed as small blue circles and stored as normalized coordinates.
• Line Drawing: A black line automatically connects consecutive points as they are added.
• Coordinate Mapping: Pixel coordinates are converted to the normalized system using mathematical formulas.
• Display Coordinates: A “Show Coordinates” button displays the rounded normalized coordinates in a message box and prints them to the terminal. The main function initializes the GUI and returns the list of collected coordinates when the interface is closed.
SVG_to_system.py
This script processes SVG files to extract, normalize, and visualize continuous drawing paths as (x, y) coordinates. It leverages the svgpathtools library to parse paths and resample them into evenly spaced points, ensuring smooth and continuous trajectories.
Key Features:
• Path Normalization: The normalize coordinates function scales points to fit within specified x and y ranges while maintaining relative proportions.
• Resampling: The resample coordinates function reduces the number of points for efficient processing.
• Interactive Visualization: Normalized paths are visualized using matplotlib, allowing users to modify the path by clicking to remove unwanted line segments. The script’s main function initializes SVG parsing and then normalizes coordinates. The GUI makes it ideal for editing parsed information to correct the image. The script returns the final coordinates as a list of collected coordinates when the GUI is closed.
DXF_to_system.py
This script processes DXF files to extract, rescale, and visualize drawing paths as connected (x, y) coordinates. It utilizes the ezdxf library to identify geometries such as LINE, POLYLINE, and LWPOLYLINE, constructing continuous paths while eliminating redundant points.
Key Features:
• Path Extraction: Extracts coordinates from DXF geometries and constructs smooth, connected paths.
• Rescaling: The rescale coordinates function linearly maps the extracted points to the defined ranges (−0.4 to 0.4 for x, and 0.2 to 1.0 for y), preserving the original proportions.
• Precision Rounding: Coordinates are rounded for accuracy during processing.
• Visualization: The visualize path function uses matplotlib to simulate the trajectory of a robot arm or drawing tool. The script’s main function handles the DXF processing, path scaling, and outputting results in a structured format.
ROS_script.py
The ROS script enables motion planning and visualization for a UR5e robot arm using MoveIt2, allowing the arm to execute predefined joint goals and dynamically generated pose goals, with optional RViz visualization of its trajectory. Users can select a coordinate-generating script (draw to system, svg to system, or dxf to system), which returns an array of (x, y) coordinates for the robot to follow.
Key Features:
• ROS 2 Node Initialization: The script initializes the ROS 2 node and configures MoveIt2 with the robot’s joint names and motion parameters.
• Predefined and Dynamic Motion Planning: The robot first executes two predefined joint configurations before moving to dynamic pose goals derived from user-provided coordinates. Each pose includes a position and fixed orientation.
• Motion Smoothness: Adjustable velocity and acceleration limits ensure smooth operation during motion planning.
• Real-Time Visualization: Trajectories can be visualized in real-time using RViz, with an optional trail visualization via the Marker tool.
• Multi-Threading for ROS 2 Activity: The script employs threading to keep the ROS 2 node active during execution.
• Clean Shutdown: Ensures proper ROS 2 shutdown and thread cleanup for safe and efficient operation. By combining user-selected coordinate scripts with RViz simulations and MoveIt2 motion planning, this framework compartmentalized, making it easier to navigate through the different options. The master script translates graphical designs or external input files into precise robotic movements.