This repository contains ROS2 packages for controlling and interacting with CloudGripper system.
- Clone this repo into your ROS2 workspace's
srcdirectory. - Navigate to your workspace root and run
colcon build. - Source the setup script:
source install/setup.bash.
Ensure CLOUDGRIPPER_API_KEY is set in your environment for authentication with the CloudGripper API.
export CLOUDGRIPPER_API_KEY="your_api_key_here"- Start the launch file with parameters:
ros2 launch cloudgripper_ros cloudgripper_launch.py -- robot_name:=robot1. This example shows how to set therobot_nameparameter torobot1. Adjust the parameter value as provided with API token. - Subscribe to camera images:
/base_camera/imagefor the base camera,/top_camera/imagefor the top camera.
- Base Camera: Call the
get_camera_imageservice with thecamera_typeparameter set tobaseto fetch the base camera image. - Top Camera: Call the
get_camera_imageservice with thecamera_typeparameter set totopto fetch the top camera image.
The image_re_publish.py node subscribes to the image services and republishes the images to ROS topics.
-
Functionality:
- The node subscribes to the
get_camera_imageservices for both base and top cameras. - It retrieves images once from each camera service and then publishes these current images to
/base_camera/imageand/top_camera/image.
- The node subscribes to the
-
Usage:
- To launch this node and start image republishing:
ros2 run cloudgripper_ros image_re_publish
- To launch this node and start image republishing:
- Fetch State: Call the
get_robot_stateservice to fetch the current state of the CloudGripper.
- XY Position Control Topic (
/xy): Publishgeometry_msgs/msg/Pointto set X (0.0 to 1.0) and Y (0.0 to 1.0) coordinates. - Z Position Control Topic (
/z): Publishstd_msgs/msg/Float32for Z movement (0.0 to 1.0). - Gripper Control Topic (
/gripper_value): Publishstd_msgs/msg/Float32to adjust the gripper' position (0.0 to 1.0). - Rotation Control Topic (
/rotation_angle): Publishstd_msgs/msg/Int16to adjust the rotation angle (0 to 180 degrees). - Step Commands Topic (
/step_command): Publishstd_msgs/msg/Stringmessages with values"right","left","forward", or"backward"to step move the robot.
- Activate Keyboard Control: Run the node with
ros2 run teleop_twist_keyboard teleop_twist_keyboard. This will enable real-time keyboard control for the Cloudgripper. - Key Bindings:
- Movement:
i: Move forwardk: Move backwardj: Move leftl: Move right
- Z-Axis Control:
t: Move upb: Move down
- Rotation Control:
u: Rotate lefti: Rotate right
- Gripper Control:
m: Close gripper,: Open gripper
- Movement:
Ensure the terminal window running the keyboard control node is active to receive key inputs.