Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Katie Hughes committed Feb 27, 2025
1 parent 27dceae commit 92994d7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
37 changes: 35 additions & 2 deletions spot_controllers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@

This is a ROS 2 package that provides custom ROS 2 controllers that can be used with [spot_ros2_control](../spot_ros2_control/).

Currently, this package consists of a single generic controller: `spot_controllers/ForwardStateController`. This controller allows you to forward a set of commands over a set of interfaces. It is used with `spot_ros2_control` to forwad commands for position, velocity, and effort for all joints at the same time.
This package contains two controllers: `spot_controllers/ForwardStateController` and `spot_controllers/SpotJointController`.
Example configurations for setting up this controllers can be found in [`spot_ros2_control/config`](../spot_ros2_control/config/).

Example configurations for setting up this controller can be found in [`spot_ros2_control/config`](../spot_ros2_control/config/).
## `ForwardStateController`

This is a generic controller allows you to directly forward a set of commands over a set of interfaces.
It builds on top of ROS 2 control's [`forward_command_controller`](https://github.com/ros-controls/ros2_controllers/tree/master/forward_command_controller).
It is used with `spot_ros2_control` to forwad commands for position, velocity, and effort for all joints at the same time.


## `SpotJointController`

This is a streaming controller specific to Spot's hardware interface, used to directly forward any subset of position, velocity, load, k_q_p, and k_qd_p over any subset of Spot's joints.
It receives commands of type `spot_msgs/msg/JointCommand`, which is almost the same as a `sensor_msgs/msg/JointState` message but with extra fields for Spot's `k_q_p` and `k_qd_p` command interfaces.
This controller claims all command interfaces of the robot on activation, but your `JointCommands` do not have to contain commands for all interfaces -- they can just contain a subset.
The `name` field in this topic should contain the names of the joints you wish to control, and for each entry in `name`, you can fill one or more of the elements in `postition`, `velocity`, `effort`, `k_q_p`, or `k_qd_p`.
Any interfaces that are not specified in this message will be left unchanged at their last commanded value.

For example, to send one position command to one joint, the joint command would be formed such as:
```
name: ["joint_1"]
postion: [1.0]
velocity: []
effort: []
k_q_p: []
k_qd_p: []
```
Or to control position, velocity, and k_qd_p of 3 different joints:
```
name: ["joint_1", "joint_2", "joint_3"]
postion: [1.0, 2.0, 3.0]
velocity: []
effort: [4.0, 5.0, 6.0]
k_q_p: []
k_qd_p: [7.0, 8.0, 9.0]
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,3 @@ spot_joint_controller:
default_value: [],
description: "Names of the joint to control",
}
joint_prefix: {
type: string,
default_value: "",
description: "Optional prefix to apply to joint names"
}
interface_names: {
type: string_array,
default_value: [],
description: "Names of the interfaces to command",
}

0 comments on commit 92994d7

Please sign in to comment.