Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added README.md for dummy_sensors #573

Merged
merged 4 commits into from
Jan 23, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions dummy_robot/dummy_sensors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
## **What Is This?**

This demo creates and runs 2 ROS2 **nodes** individually, namely `dummy_laser` and `dummy_joint_states`.
cardboardcode marked this conversation as resolved.
Show resolved Hide resolved

**dummy_laser** publishes `sensor_msgs::msg::LaserScan` on a ROS2 publisher topic, `/scan`.
cardboardcode marked this conversation as resolved.
Show resolved Hide resolved

**dummy_joint_states** publishes `sensor_msgs::msg::JointState` on a ROS2 publisher topic, `/joint_states`.
cardboardcode marked this conversation as resolved.
Show resolved Hide resolved

Both **dummy_laser** and **dummy_joint_states** are dependencies of **dummy_robot_bringup**. Please refer to [dummy_robot_bringup](https://github.com/ros2/demos/tree/rolling/dummy_robot/dummy_robot_bringup).
cardboardcode marked this conversation as resolved.
Show resolved Hide resolved

## **Build**

```bash
colcon build --packages-select dummy_sensors
```

## **Run**

### **1 - dummy_laser**

```bash
ros2 run dummy_sensors dummy_laser
```

```bash
# Terminal Output
[INFO] [1658564972.776089023] [dummy_laser]: angle inc: 0.004363
[INFO] [1658564972.776138078] [dummy_laser]: scan size: 1081
[INFO] [1658564972.776148752] [dummy_laser]: scan time increment: 0.000028
```

### **2 - dummy_joint_states**

```bash
ros2 run dummy_sensors dummy_joint_states
```


## **Verify**

A similar terminal output should be seen after running commands described in the **Run** section above:

### **1 - dummy_laser**

```bash
# Open new terminal.
ros2 topic echo /laser
```

```bash
# Terminal Output
---
header:
stamp:
sec: 1658569107
nanosec: 51491730
frame_id: single_rrbot_hokuyo_link
angle_min: -2.356194496154785
angle_max: 2.356194496154785
angle_increment: 0.004363323096185923
time_increment: 2.7777778086601757e-05
scan_time: 0.03999999910593033
range_min: 0.0
range_max: 10.0
ranges:
- 0.39602306485176086
- 0.39602306485176086
- 0.39602306485176086
- 0.39602306485176086
- 0.39602306485176086
- 0.39602306485176086
- 0.39602306485176086
- '...'
intensities: []
---
```

### **2 - dummy_joint_states**

```bash
# Open new terminal.
ros2 topic echo /joint_states
```

```bash
# Terminal Output
---
header:
stamp:
sec: 1658569569
nanosec: 414505214
frame_id: ''
name:
- single_rrbot_joint1
- single_rrbot_joint2
position:
- -0.033653174530243454
- -0.033653174530243454
velocity: []
effort: []
---
header:
stamp:
sec: 1658569569
nanosec: 434418040
frame_id: ''
name:
- single_rrbot_joint1
- single_rrbot_joint2
position:
- -0.13326191698696957
- -0.13326191698696957
velocity: []
effort: []
---
header:
stamp:
sec: 1658569569
nanosec: 454443902
frame_id: ''
name:
- single_rrbot_joint1
- single_rrbot_joint2
position:
- -0.2315391504196944
- -0.2315391504196944
velocity: []
effort: []
---
header:
stamp:
sec: 1658569569
nanosec: 474417706
frame_id: ''
name:
- single_rrbot_joint1
- single_rrbot_joint2
position:
- -0.3275029211980919
- -0.3275029211980919
velocity: []
effort: []
---
header:
stamp:
sec: 1658569569
nanosec: 494442418
frame_id: ''
name:
- single_rrbot_joint1
- single_rrbot_joint2
position:
- -0.4201943910459491
- -0.4201943910459491
velocity: []
effort: []
---
```


## **References**

- `sensor_msgs::msg::LaserScan` Message Format: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/LaserScan.msg
- `sensor_msgs::msg::JointState` Message Format: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/JointState.msg
cardboardcode marked this conversation as resolved.
Show resolved Hide resolved