Skip to content

Commit bbdb16b

Browse files
Package level documenation for common_msgs
1 parent 04a7d72 commit bbdb16b

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Common Messages (common_msgs)
2+
3+
## File Tree/Package Structure
4+
This message package follows standard ROS2 package scheme:
5+
```
6+
common_msgs/
7+
├── CMakeLists.txt
8+
├── package.xml
9+
├── README.md
10+
└── msg/
11+
├── ArmPose.msg
12+
├── HandPose.msg
13+
└── JointState.msg
14+
```
15+
16+
## Purpose
17+
The `common_msgs` package serves as a global package for message definitions that are commonly used across various components and packages within the humanoid project.
18+
19+
## Inputs & Outputs
20+
This package primarily defines message structures. Therefore:
21+
- **Outputs**: Provides `.msg` definitions that other ROS 2 packages can import and use.
22+
- **Inputs**: Does not process data or subscribe to topics; it only defines data structures.
23+
24+
## Key Features
25+
- **Message Definitions**: Contains a collection of `.msg` files, each defining a specific data structure. These messages are designed to be generic and applicable in multiple contexts.
26+
27+
### Message Definitions
28+
- `ArmPose.msg`: Defines the pose of the humanoid arm, including optional HandPose inside.
29+
- `HandPose.msg`: Defines the pose of the humanoid hand, including each JointState of each finger's joints.
30+
- `JointState.msg`: Defines the state of a joint, including position, velocity, orientation, and effort.
31+
32+
## Usage
33+
To use the messages defined in this package within another ROS 2 package:
34+
35+
1. **Copy the package into your Docker image's source workspace**: Add the following line to your Dockerfile (typically `root/docker/MODULE_NAME/MODULE_NAME.Dockerfile`), typically in the section where you copy your source code:
36+
```dockerfile
37+
# # Copy in source code
38+
# # COPY autonomy/wato_msgs/sample_msgs sample_msgs
39+
COPY autonomy/wato_msgs/common_msgs common_msgs
40+
```
41+
42+
2. **Add Dependency**: Ensure that `common_msgs` is listed as a dependency in the `package.xml` of your consuming package:
43+
```xml
44+
<depend>common_msgs</depend>
45+
```
46+
3. **Include in CMakeLists.txt** (for C++ packages):
47+
```cmake
48+
find_package(common_msgs REQUIRED)
49+
ament_target_dependencies(your_target_name common_msgs)
50+
```
51+
4. **Import in Python scripts**:
52+
```python
53+
from common_msgs.msg import YourMessageName
54+
```
55+
5. **Include in C++ code**:
56+
```cpp
57+
#include "common_msgs/msg/your_message_name.hpp"
58+
```
59+
60+
### Testing
61+
Currently, this package primarily contains message definitions, so testing focuses on ensuring they can be correctly compiled and used by dependent packages.
62+
63+
## Configuration
64+
- **Parameters**: No configurable parameters are defined within this package itself.

0 commit comments

Comments
 (0)