Skip to content

Commit 243dcec

Browse files
committed
new changes
1 parent 54b3b01 commit 243dcec

File tree

7 files changed

+78
-58
lines changed

7 files changed

+78
-58
lines changed

autonomy/behaviour/voxel_grid/voxel_grid/voxel_grid_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def depth_callback(self, msg: Image):
101101

102102
def process_rgbd_if_ready(self):
103103
# Check depth + intrinsics are for voxelization
104-
if self.depth_image is None or self.have_intrinsics == False:
104+
if self.depth_image is None or not self.have_intrinsics:
105105
return
106106

107107
points = self.depth_to_pointcloud(self.depth_image)

autonomy/perception/launch/perception.launch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ def generate_launch_description():
99
DeclareLaunchArgument(
1010
'log_level',
1111
default_value='info',
12-
description='Log level for the perception node'
12+
description='Log level for the dummy publisher node'
1313
),
1414

1515
Node(
1616
package='perception',
17-
executable='perception_node',
18-
name='perception_node',
17+
executable='dummy_publisher_node',
18+
name='dummy_publisher_node',
1919
output='screen',
2020
parameters=[
2121
{'log_level': LaunchConfiguration('log_level')}

autonomy/perception/perception/dummy_publisher_node.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from sensor_msgs.msg import Image, CameraInfo
66
from std_msgs.msg import Header
7-
7+
import cv2
88
from cv_bridge import CvBridge
99
import numpy as np
1010

@@ -44,20 +44,36 @@ def publish_dummy_data(self):
4444
header.stamp = now
4545
header.frame_id = 'camera_link'
4646

47-
rgb_image = np.random.randint(
48-
0, 255, (480, 640, 3), dtype=np.uint8
49-
)
47+
# Create a simple scene with geometric shapes at different depths
48+
rgb_image = np.zeros((480, 640, 3), dtype=np.uint8)
49+
depth_image = np.full((480, 640), 3000, dtype=np.uint16) # Background at 3000mm
50+
51+
# Add a large rectangle (closer object) - like a wall or box
52+
cv2.rectangle(rgb_image, (150, 120), (490, 360), (100, 150, 200), -1) # Filled rectangle
53+
cv2.rectangle(depth_image, (150, 120), (490, 360), 1200, -1) # 1200mm depth
54+
55+
# Add a smaller circle (closest object) - like a ball
56+
cv2.circle(rgb_image, (320, 240), 80, (50, 200, 50), -1) # Green circle
57+
cv2.circle(depth_image, (320, 240), 80, 800, -1) # 800mm depth (closest)
58+
59+
# Add another rectangle (medium distance)
60+
cv2.rectangle(rgb_image, (50, 300), (200, 450), (200, 100, 100), -1) # Reddish rectangle
61+
cv2.rectangle(depth_image, (50, 300), (200, 450), 1800, -1) # 1800mm depth
62+
63+
# Optional: Add some gradient/texture to make it more realistic
64+
noise = np.random.randint(-20, 20, rgb_image.shape, dtype=np.int16)
65+
rgb_image = np.clip(rgb_image.astype(np.int16) + noise, 0, 255).astype(np.uint8)
66+
67+
# Add slight depth variation (noise)
68+
depth_noise = np.random.randint(-30, 30, depth_image.shape, dtype=np.int16)
69+
depth_image = np.clip(depth_image.astype(np.int32) + depth_noise, 0, 65535).astype(np.uint16)
5070

5171
rgb_msg = self.bridge.cv2_to_imgmsg(
5272
rgb_image, encoding='bgr8'
5373
)
5474
rgb_msg.header = header
5575
self.rgb_pub.publish(rgb_msg)
5676

57-
depth_image = np.full(
58-
(480, 640), 1500, dtype=np.uint16
59-
)
60-
6177
depth_msg = self.bridge.cv2_to_imgmsg(
6278
depth_image, encoding='mono16'
6379
)

docker/behaviour/octo_map/octo_map.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=ghcr.io/watonomous/robot_base/base:humble
1+
ARG BASE_IMAGE=ghcr.io/watonomous/robot_base/base:humble-ubuntu22.04
22

33
################################ Source ################################
44
FROM ${BASE_IMAGE} AS source

docker/behaviour/voxel_grid/voxel_grid.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=ghcr.io/watonomous/robot_base/base:humble
1+
ARG BASE_IMAGE=ghcr.io/watonomous/robot_base/base:humble-ubuntu22.04
22

33
################################ Source ################################
44
FROM ${BASE_IMAGE} AS source
@@ -15,7 +15,7 @@ COPY autonomy/wato_msgs/common_msgs wato_msgs/common_msgs
1515
# RUN rosdep update
1616
# RUN rosdep install --from-paths . --ignore-src -r -s \
1717
# | grep 'apt-get install' \
18-
# | awk '{print $3}' \Is
18+
# | awk '{print $3}' \
1919
# | sort > /tmp/colcon_install_list
2020

2121
RUN apt-get -qq update

docker/perception/perception.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=ghcr.io/watonomous/robot_base/base:humble
1+
ARG BASE_IMAGE=ghcr.io/watonomous/robot_base/base:humble-ubuntu22.04
22

33
################################ Source ################################
44
FROM ${BASE_IMAGE} AS source

modules/docker-compose.behaviour.yaml

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
- NVIDIA_VISIBLE_DEVICES=all
1717
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
1818
profiles: [deploy]
19+
working_dir: /root/ament_ws
1920
deploy:
2021
resources:
2122
reservations:
@@ -34,50 +35,53 @@ services:
3435
- NVIDIA_VISIBLE_DEVICES=all
3536
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
3637
profiles: [develop]
38+
working_dir: /root/ament_ws
3739
volumes:
3840
- ${MONO_DIR}/autonomy/behaviour/voxel_grid:/root/ament_ws/src/voxel_grid
3941
command: tail -F anything
4042

41-
octo_map:
42-
build:
43-
context: ..
44-
dockerfile: docker/behaviour/octo_map/octo_map.Dockerfile
45-
cache_from:
46-
- "${BEHAVIOUR_OCTO_IMAGE:?}:${TAG}"
47-
- "${BEHAVIOUR_OCTO_IMAGE:?}:main"
48-
args:
49-
BASE_IMAGE: ${BASE_IMAGE_OVERRIDE-}
50-
image: "${BEHAVIOUR_OCTO_IMAGE:?}:${TAG}"
51-
runtime: nvidia
52-
environment:
53-
- NVIDIA_VISIBLE_DEVICES=all
54-
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
55-
profiles: [deploy]
56-
deploy:
57-
resources:
58-
reservations:
59-
devices:
60-
- driver: nvidia
61-
capabilities: [gpu]
62-
volumes:
63-
- ${MONO_DIR}/autonomy/behaviour/octo_map:/root/ament_ws/src/octo_map
64-
command: tail -F anything
43+
# octo_map:
44+
# build:
45+
# context: ..
46+
# dockerfile: docker/behaviour/octo_map/octo_map.Dockerfile
47+
# cache_from:
48+
# - "${BEHAVIOUR_OCTO_IMAGE:?}:${TAG}"
49+
# - "${BEHAVIOUR_OCTO_IMAGE:?}:main"
50+
# args:
51+
# BASE_IMAGE: ${BASE_IMAGE_OVERRIDE-}
52+
# image: "${BEHAVIOUR_OCTO_IMAGE:?}:${TAG}"
53+
# runtime: nvidia
54+
# environment:
55+
# - NVIDIA_VISIBLE_DEVICES=all
56+
# - NVIDIA_DRIVER_CAPABILITIES=compute,utility
57+
# profiles: [deploy]
58+
# working_dir: /root/ament_ws
59+
# deploy:
60+
# resources:
61+
# reservations:
62+
# devices:
63+
# - driver: nvidia
64+
# capabilities: [gpu]
65+
# volumes:
66+
# - ${MONO_DIR}/autonomy/behaviour/octo_map:/root/ament_ws/src/octo_map
67+
# command: tail -F anything
6568

66-
octo_map_dev:
67-
build:
68-
context: ..
69-
dockerfile: docker/behaviour/octo_map/octo_map.Dockerfile
70-
cache_from:
71-
- "${BEHAVIOUR_OCTO_IMAGE:?}:dev_${TAG}"
72-
- "${BEHAVIOUR_OCTO_IMAGE:?}:main"
73-
args:
74-
BASE_IMAGE: ${BASE_IMAGE_OVERRIDE-}
75-
image: "${BEHAVIOUR_OCTO_IMAGE:?}:dev_${TAG}"
76-
runtime: nvidia
77-
environment:
78-
- NVIDIA_VISIBLE_DEVICES=all
79-
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
80-
profiles: [develop]
81-
volumes:
82-
- ${MONO_DIR}/autonomy/behaviour/octo_map:/root/ament_ws/src/octo_map
83-
command: tail -F anything
69+
# octo_map_dev:
70+
# build:
71+
# context: ..
72+
# dockerfile: docker/behaviour/octo_map/octo_map.Dockerfile
73+
# cache_from:
74+
# - "${BEHAVIOUR_OCTO_IMAGE:?}:dev_${TAG}"
75+
# - "${BEHAVIOUR_OCTO_IMAGE:?}:main"
76+
# args:
77+
# BASE_IMAGE: ${BASE_IMAGE_OVERRIDE-}
78+
# image: "${BEHAVIOUR_OCTO_IMAGE:?}:dev_${TAG}"
79+
# runtime: nvidia
80+
# environment:
81+
# - NVIDIA_VISIBLE_DEVICES=all
82+
# - NVIDIA_DRIVER_CAPABILITIES=compute,utility
83+
# profiles: [develop]
84+
# working_dir: /root/ament_ws
85+
# volumes:
86+
# - ${MONO_DIR}/autonomy/behaviour/octo_map:/root/ament_ws/src/octo_map
87+
# command: tail -F anything

0 commit comments

Comments
 (0)