I am working on a project to use a 3D camera to monitor a free-moving object as it is being operated on by a cnc. If the object happens to move, the camera will monitor that movement and will adjust the cnc toolpath to ensure correct operation. Given I am using a commercial desktop CNC, my idea is to create a HAL to take the object tracking data to correct the original g-code. I was hoping someone could indicate if using ROS to control a commercial cnc machine was possible as ROS has a lot of the software features for closed loop control already made. Thanks!
1 Answer
Using ROS to control a commercial CNC machine is indeed possible
Camera Integration: You can use ROS drivers for your 3D camera to capture and process images. Packages like cv_bridge can help convert image data into a usable format for processing.
Object Tracking: Using ROS packages like image_geometry or even deep learning frameworks that work with ROS, you can implement object tracking. This would involve detecting the object’s position and orientation in real-time and calculating any deviation from its expected position.
G-Code Manipulation: This is the trickier part. You would need to create a custom ROS node that can interpret G-code and adjust it based on the tracking data. This might involve parsing
you can as many nodes as you want to add other functionalities to the overall system.