Skip to content

Commit f3f6e28

Browse files
committed
Added launch file for realsense example + cleaned up the README.md
1 parent 21914e4 commit f3f6e28

File tree

2 files changed

+82
-168
lines changed

2 files changed

+82
-168
lines changed

examples/8_images/README.md

Lines changed: 11 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ sudo apt install ros-${ROS_DISTRO}-realsense2-camera
6565

6666
Choose your camera type and launch the appropriate system:
6767

68-
### 🎮 **Option A: Synthetic Camera (Turtlesim) - Recommended for Beginners**
68+
### 🎮 **Option A: Synthetic Camera (Burger) - Recommended for Beginners**
6969

7070
#### Using Launch File (Easiest)
7171

@@ -74,7 +74,7 @@ Choose your camera type and launch the appropriate system:
7474
cd examples/8_images
7575

7676
# Launch synthetic camera system
77-
ros2 launch ros_mcp_images_demo.launch.py camera_type:=synthetic
77+
ros2 launch ros_mcp_images_demo.launch.py
7878
```
7979

8080
#### Manual Launch (For Learning)
@@ -102,7 +102,7 @@ ros2 run image_transport republish raw in:=/image out:=/image/compressed
102102
cd examples/8_images
103103

104104
# Launch RealSense camera system
105-
ros2 launch ros_mcp_images_demo.launch.py camera_type:=realsense
105+
ros2 launch ros_mcp_images_demo_realsense.launch.py
106106
```
107107

108108
#### Manual Launch (For Learning)
@@ -124,7 +124,7 @@ ros2 run image_tools showimage --ros-args --remap /image:=/camera/camera/depth/i
124124
ros2 run image_transport republish raw in:=/camera/camera/color/image_raw out:=/camera/camera/color/image_raw/compressed
125125
```
126126

127-
### 🔧 **What Each System Provides**
127+
### What Each System Provides
128128

129129
#### Synthetic Camera System:
130130
- **rosbridge_server** - WebSocket server for MCP communication
@@ -147,7 +147,7 @@ Check that all components are working:
147147
ros2 topic list
148148
```
149149

150-
### 🎮 **For Synthetic Camera System, you should see:**
150+
### For Synthetic Camera System, you should see:
151151
```
152152
/image - Raw camera feed (burger images)
153153
/image/compressed - Compressed camera feed
@@ -156,7 +156,7 @@ ros2 topic list
156156
/connected_clients - Client information
157157
```
158158

159-
### 📷 **For RealSense Camera System, you should see:**
159+
### For RealSense Camera System, you should see:
160160
```
161161
/camera/camera/color/image_raw - Color camera feed
162162
/camera/camera/color/camera_info - Color camera calibration
@@ -169,7 +169,7 @@ ros2 topic list
169169
/connected_clients - Client information
170170
```
171171

172-
### 🔍 **Test Camera Feed**
172+
### Test Camera Feed
173173

174174
```bash
175175
# For synthetic camera
@@ -198,7 +198,7 @@ Once connected, you can start using natural language commands to interact with t
198198

199199
## Step 4: Basic Image Operations
200200

201-
### 📸 Capture Images
201+
### Capture Images
202202

203203
Try these commands with your AI assistant:
204204

@@ -228,7 +228,7 @@ Capture the current color camera feed
228228
Take a picture from /camera/camera/color/image_raw
229229
```
230230

231-
### 🔍 Analyze Images
231+
### Analyze Images
232232

233233
#### General Analysis:
234234
```
@@ -269,69 +269,7 @@ Describe the scene from the RealSense camera
269269
What's the lighting like in the image?
270270
```
271271

272-
### 🎛️ Control Image Processing
273-
274-
#### For Synthetic Camera:
275-
```
276-
Flip the image
277-
```
278-
279-
```
280-
Stop flipping the image
281-
```
282-
283-
```
284-
Publish flip commands for 10 seconds
285-
```
286-
287-
#### For RealSense Camera:
288-
```
289-
Subscribe to the depth camera feed
290-
```
291-
292-
```
293-
Switch between color and depth images
294-
```
295-
296-
```
297-
Analyze the depth information
298-
```
299-
300-
## Step 5: Advanced Image Analysis
301-
302-
### Object Detection and Counting
303-
304-
#### For Synthetic Camera:
305-
```
306-
How many burgers are in the image?
307-
```
308-
309-
```
310-
Count all the objects you can see
311-
```
312-
313-
```
314-
What objects are visible in the synthetic camera feed?
315-
```
316-
317-
#### For RealSense Camera:
318-
```
319-
What objects are visible in the room?
320-
```
321-
322-
```
323-
Count the furniture in the image
324-
```
325-
326-
```
327-
Identify any people in the camera feed
328-
```
329-
330-
```
331-
Describe the spatial layout of the room
332-
```
333-
334-
## Step 6: Advanced Camera Control
272+
## Step 5: Advanced Camera Control
335273

336274
### Camera Parameters
337275

@@ -361,39 +299,6 @@ Get the camera calibration information
361299
Check the depth camera parameters
362300
```
363301

364-
### Image Topics
365-
366-
#### For Synthetic Camera:
367-
```
368-
What image topics are available?
369-
```
370-
371-
```
372-
Subscribe to the compressed image topic
373-
```
374-
375-
```
376-
Monitor both raw and compressed feeds
377-
```
378-
379-
#### For RealSense Camera:
380-
```
381-
What RealSense topics are available?
382-
```
383-
384-
```
385-
Subscribe to the depth camera topic
386-
```
387-
388-
```
389-
Monitor both color and depth feeds
390-
```
391-
392-
```
393-
Get camera metadata information
394-
```
395-
396-
397302
## Troubleshooting
398303

399304
### Common Issues
@@ -481,71 +386,9 @@ Get camera metadata information
481386

482387
</details>
483388

484-
485-
## Next Steps
486-
487-
### 🎯 Immediate Next Steps
488-
489-
1. **Try different image analysis commands** with your AI assistant
490-
2. **Experiment with image manipulation** - flipping, filtering, enhancement
491-
3. **Test movement detection** with dynamic scenes
492-
4. **Explore object counting** with different objects
493-
494-
### 🎮 **For Synthetic Camera Users**
495-
496-
1. **Experiment with image_tools**:
497-
- Capture burger images with different settings
498-
- Test image analysis with different burger orientations
499-
- Try different image processing parameters
500-
501-
2. **Try advanced synthetic scenarios**:
502-
- Different burger modes
503-
- Various image resolutions
504-
- Dynamic image generation
505-
506-
### 📷 **For RealSense Camera Users**
507-
508-
1. **Explore depth information**:
509-
- Analyze depth images
510-
- Measure distances to objects
511-
- Create 3D scene understanding
512-
513-
2. **Advanced computer vision**:
514-
- Object detection and tracking
515-
- Hand gesture recognition
516-
- Room mapping and navigation
517-
518-
### 🚀 Advanced Exploration
519-
520-
1. **Connect to other cameras**:
521-
- USB webcams
522-
- Other ROS-compatible cameras
523-
- Simulation environments (Gazebo, Isaac Sim)
524-
525-
2. **Implement custom image processing**:
526-
- Edge detection
527-
- Color filtering
528-
- Object tracking
529-
- Face detection
530-
- SLAM integration
531-
532-
3. **Integrate with other ROS systems**:
533-
- Navigation stacks
534-
- Manipulation systems
535-
- Robot control systems
536-
537-
### 📚 Learning Resources
389+
## Learning Resources
538390

539391
- [ROS2 Image Processing Tutorials](https://docs.ros.org/en/humble/Tutorials/Intermediate/Image_Processing/)
540392
- [OpenCV with ROS2](https://docs.ros.org/en/humble/Tutorials/Intermediate/Image_Processing/)
541393
- [Computer Vision with ROS](https://wiki.ros.org/cv_bridge)
542394
- [Image Transport Tutorials](https://docs.ros.org/en/humble/Tutorials/Intermediate/Image_Processing/)
543-
544-
545-
---
546-
547-
**Happy image processing!** 📸🤖
548-
549-
This tutorial has shown you how to use natural language to interact with camera systems through the ROS MCP Server. You can now apply these same principles to real robots, surveillance systems, or any ROS-based image processing pipeline!
550-
This tutorial has shown you how to use natural language to interact with camera systems through the ROS MCP Server. You can now apply these same principles to real robots, surveillance systems, or any ROS-based image processing pipeline!
551-
This tutorial has shown you how to use natural language to interact with camera systems through the ROS MCP Server. You can now apply these same principles to real robots, surveillance systems, or any ROS-based image processing pipeline!
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import os
2+
3+
from ament_index_python.packages import get_package_share_directory
4+
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
5+
from launch.launch_description_sources import AnyLaunchDescriptionSource
6+
from launch.substitutions import LaunchConfiguration
7+
from launch_ros.actions import Node
8+
9+
from launch import LaunchDescription
10+
11+
12+
def generate_launch_description():
13+
# Declare port argument for rosbridge
14+
port_arg = DeclareLaunchArgument(
15+
"port", default_value="9090", description="Port for rosbridge websocket"
16+
)
17+
18+
# rosbridge websocket
19+
rosbridge_launch = IncludeLaunchDescription(
20+
AnyLaunchDescriptionSource(
21+
os.path.join(
22+
get_package_share_directory("rosbridge_server"),
23+
"launch",
24+
"rosbridge_websocket_launch.xml",
25+
)
26+
),
27+
launch_arguments={"port": LaunchConfiguration("port")}.items(),
28+
)
29+
30+
# Realsense camera driver
31+
realsense_launch = IncludeLaunchDescription(
32+
AnyLaunchDescriptionSource(
33+
os.path.join(
34+
get_package_share_directory("realsense2_camera"),
35+
"launch",
36+
"rs_launch.py",
37+
)
38+
)
39+
)
40+
41+
# showimage for realsense (color)
42+
showimage_real = Node(
43+
package="image_tools",
44+
executable="showimage",
45+
name="showimage_real",
46+
remappings=[("/image", "/camera/camera/color/image_raw")],
47+
)
48+
49+
# republish compressed for realsense color stream
50+
republish_real = Node(
51+
package="image_transport",
52+
executable="republish",
53+
name="republish_real",
54+
arguments=["raw"],
55+
remappings=[
56+
("in", "/camera/camera/color/image_raw"),
57+
("out", "/camera/camera/color/image_raw/compressed"),
58+
],
59+
)
60+
61+
return LaunchDescription(
62+
[
63+
port_arg,
64+
rosbridge_launch,
65+
realsense_launch,
66+
showimage_real,
67+
republish_real,
68+
]
69+
)
70+
71+

0 commit comments

Comments
 (0)