https://github.com/woolfrey/server_serial_link
ROS2 Action server for controlling a serial link robot.
https://github.com/woolfrey/server_serial_link
Last synced: 3 months ago
JSON representation
ROS2 Action server for controlling a serial link robot.
- Host: GitHub
- URL: https://github.com/woolfrey/server_serial_link
- Owner: Woolfrey
- License: gpl-3.0
- Created: 2024-03-22T15:53:29.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-28T17:07:34.000Z (3 months ago)
- Last Synced: 2025-02-28T21:51:09.159Z (3 months ago)
- Language: C++
- Size: 1.96 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This ROS2 package provides a set of action servers for controlling serial link robot arms. It builds upon [RobotLibrary](https://github.com/Woolfrey/software_robot_library) C++ library which contains the fundamental algorithms for kinematics, dynamics, and control.
> [!NOTE]
> This package is still under development. More features will be added.## Table of Contents
- [Overview](#overview)
- [Components](#components)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Launching the Nodes](#launching-the-nodes)
- [Testing the Action Server](#testing-the-action-server)
- [Contributing](#contributing)
- [License](#license)## Overview
### Components
These are the current basic components that show how to coordinate the different modules to enable real-time control of a robot arm. The design is modular, and you can create your own action servers & action clients as needed. More actions & features will be added in future.
- `include/ModelUpdater.h`: This uses a pointer to a `RobotLibrary::KinematicTree` object which defines a robot model. It subscribes to a `sensor_msgs/msg/JointState.msg` topic and uses it to compute the forward kinematics and inverse dynamics based on the current state. The subscription topic name can be set as a constructor argument.
- `src/velocity_control_server.cpp`: This creates the `RobotLibrary::KinematicTree` model, a `RobotLibrary::SerialKinematicControl` controller, and links together the `ModelUpdater` node, as well as creating & advertising the `TrackJointTrajectory` and `TrackCartesianTrajectory` action servers. It publishes joint commands using a custom `JointCommand.msg` message. You can write your own ROS2 subscriber to subscribe and send these to your robot.
- `src/demo_client.cpp`: This communicates with the `velocity_control_server` to demonstrate how to perform joint & Cartesian control actions.
- `src/mujoco_relay.cpp`: This node works in conjunction with this [MuJoCo interface](https://github.com/Woolfrey/interface_mujoco_ros2) 3D simulation. It subscribes to the `JointCommand.msg` topic from the action servers, and passes on a `std_msgs::msg::Float64MultiArray.msg` which is then used to control the simulated robot.
- `launch/mujoco_velocity_mode.py`: This contains various launch parameters, such as the URDF file for the robot model, control gains in the `/config` directory, subscription & publisher names, and launches the `mujoco_relay` node in conjunction with the MuJoCo simulation.
## Prerequisites- [ROS2](https://docs.ros.org/en/foxy/index.html), obviousyl!
- [RobotLibrary](https://github.com/Woolfrey/software_robot_library): This contains the fundamental algorithms for forward kinematics, inverse dynamics, and feedback control.
- [Eigen](https://eigen.tuxfamily.org/index.php?title=Main_Page): This is actually utilized by RobotLibrary, so if that is working then this is satisfied.
- [MuJoCo Interface](https://github.com/Woolfrey/interface_mujoco_ros2): An optional package. It is used to demonstrate this package with a 3D simulation.## Installation
1. **Clone the repository:**
```
git clone https://github.com/Woolfrey/server_serial_link.git
```2. **Build the package:**
Navigate to your ROS2 workspace and build the package:
```
cd your-ros2-workspace
colcon build
```3: **Source the workspace:**
```
source install/setup.bash
```### Usage
#### Launching the NodesThere is a launch file designed to work with the [mujoco_interface](https://github.com/Woolfrey/interface_mujoco_ros2) package.
You may modify/write your own to work with any robot.
#### Testing the Action Server
1. Launch the MuJoCo simulation. There are two options, `velocity_mode.py`, or `torque_mode.py`, but currently the action server is only working in velocity mode:
```
ros2 launch mujoco_interface velocity_mode.py
```
2. Launch the action server. It must match the control mode:
```
ros2 launch serial_link_action_server mujoco_velocity_mode.py
```3. Run the client:
```
ros2 run serial_link_action_server demo_client
```
Replace with the number of joints of the robot. Type `options` to see a list of commands.> [!TIP]
> The client is independent of the control mode! :+1:## Contributing
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
## License
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.