How to use the claw
This FAQ will guide you through the process of using the claw in our color sorting robot project. The applications for the claw are endless, and this guide will allow you to easily write code for use of the claw on a robot. The instructions below are written for ROS and Python.
Make sure you are connected to a robot with a claw. As of now, the only robots with a claw are the platform robots in the lab.
Import 'Bool' from 'std_msgs.msg':
Create a publsiher that publishes commands to the claw:
This code creates a publisher called 'servo_pub' that publishes to the '/servo' node and sends a Bool value.
Write code to open or close the claw:
A: The code provided does not control the speed of the claw. You will need to modify the code and use a different message type to control the speed.
A: There are two robots as of right now with the claw attachment, both are platform robots. One of the claws is a big claw while the other one is a smaller claw. Both can be used for different applications and in both cases, the above code should work.
A: As long as you have a publisher, you can publish a command to open or close a claw at any time during the main loop of your program. You can have multiple lines of codes that opens or closes the claw multiple times throughout a program or you can just write code to have the claw open once. It's up to you.