Skip to content

Commit 19204db

Browse files
committed
minor changes
1 parent fb72298 commit 19204db

File tree

7 files changed

+49
-483
lines changed

7 files changed

+49
-483
lines changed

launch/play_bag.launch

+21-19
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,27 @@
1919
</node>
2020

2121
<!-- Debayering of images with image_proc -->
22-
<group ns="camera_front">
23-
<node name="debayer" pkg="nodelet" type="nodelet" args="standalone image_proc/debayer" respawn="false" output="screen">
24-
<param name="image_transport" value="compressed"/>
25-
</node>
26-
</group>
27-
<group ns="camera_left">
28-
<node name="debayer" pkg="nodelet" type="nodelet" args="standalone image_proc/debayer" respawn="false" output="screen">
29-
<param name="image_transport" value="compressed"/>
30-
</node>
31-
</group>
32-
<group ns="camera_rear">
33-
<node name="debayer" pkg="nodelet" type="nodelet" args="standalone image_proc/debayer" respawn="false" output="screen">
34-
<param name="image_transport" value="compressed"/>
35-
</node>
36-
</group>
37-
<group ns="camera_right">
38-
<node name="debayer" pkg="nodelet" type="nodelet" args="standalone image_proc/debayer" respawn="false" output="screen">
39-
<param name="image_transport" value="compressed"/>
40-
</node>
22+
<group>
23+
<group ns="camera_front">
24+
<node name="debayer" pkg="nodelet" type="nodelet" args="standalone image_proc/debayer" respawn="false" output="screen">
25+
<param name="image_transport" value="compressed"/>
26+
</node>
27+
</group>
28+
<group ns="camera_left">
29+
<node name="debayer" pkg="nodelet" type="nodelet" args="standalone image_proc/debayer" respawn="false" output="screen">
30+
<param name="image_transport" value="compressed"/>
31+
</node>
32+
</group>
33+
<group ns="camera_rear">
34+
<node name="debayer" pkg="nodelet" type="nodelet" args="standalone image_proc/debayer" respawn="false" output="screen">
35+
<param name="image_transport" value="compressed"/>
36+
</node>
37+
</group>
38+
<group ns="camera_right">
39+
<node name="debayer" pkg="nodelet" type="nodelet" args="standalone image_proc/debayer" respawn="false" output="screen">
40+
<param name="image_transport" value="compressed"/>
41+
</node>
42+
</group>
4143
</group>
4244

4345
<!-- Visualization -->

nodes/hm_estimator

+7-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ from cv_bridge import CvBridge
77
from grid_map_msgs.msg import GridMap
88
from monoforce.config import Config
99
from monoforce.ros import height_map_to_point_cloud_msg, height_map_to_gridmap_msg
10-
from monoforce.utils import normalize, read_yaml
1110
from monoforce.cloudproc import estimate_heightmap, filter_grid, filter_range
1211
from monoforce.utils import position
1312
from ros_numpy import numpify, msgify
@@ -62,6 +61,10 @@ class HeightMapEstimator:
6261
t0 = time()
6362
# convert messages to points
6463
points = self.msgs_to_points(msgs)
64+
if points is None:
65+
rospy.logwarn('Could not convert messages to points')
66+
return
67+
rospy.logdebug('Points shape: %s' % str(points.shape))
6568

6669
# estimate height map
6770
hm = estimate_heightmap(points, d_min=self.cfg.d_min, d_max=self.cfg.d_max,
@@ -74,13 +77,6 @@ class HeightMapEstimator:
7477
rospy.logdebug('Estimated height map shape: %s' % str(height.shape))
7578
rospy.logdebug('HM estimation time: %.3f' % (time() - t0))
7679

77-
# publish image
78-
height_uint8 = np.asarray(255 * normalize(height), dtype='uint8')
79-
img_msg = self.cv_bridge.cv2_to_imgmsg(height_uint8, encoding='mono8')
80-
img_msg.header.stamp = msg.header.stamp
81-
img_msg.header.frame_id = msg.header.frame_id
82-
self.hm_img_pub.publish(img_msg)
83-
8480
# publish point cloud
8581
t1 = time()
8682
cloud_msg = height_map_to_point_cloud_msg(height, self.cfg.grid_res,
@@ -118,11 +114,11 @@ class HeightMapEstimator:
118114
time=msg.header.stamp,
119115
timeout=rospy.Duration(0.5))
120116
except (tf2_ros.LookupException, tf2_ros.ConnectivityException, tf2_ros.ExtrapolationException):
121-
rospy.logwarn('Could not get transform from %s to %s' % (msg.header.frame_id, self.cfg.robot_frame))
122-
return
117+
rospy.logwarn('Could not get transform from %s to %s' % (msg.header.frame_id, self.robot_frame))
118+
return None
119+
123120
Tr = numpify(tf.transform).reshape((4, 4))
124121
points = np.matmul(Tr[:3, :3], points.T).T + Tr[:3, 3]
125-
126122
all_points.append(points)
127123

128124
all_points = np.concatenate(all_points, axis=0)

scripts/create_lss_depth_data

-66
This file was deleted.

scripts/data/create_datasets.sh

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
# It also adds calibrations, colors and velocities to the point clouds
66

77
DATA_PATH=/home/$USER/data/robingas/data
8+
if [ ! -d "$DATA_PATH" ]; then
9+
echo "Data path does not exist: $DATA_PATH"
10+
exit 1
11+
fi
812
INPUT_DATA_STEP=20
913
IMU_TOPIC='/imu/data'
1014
CONTROL_MODEL='diffdrive'
@@ -22,11 +26,19 @@ SEQUENCES=(
2226
)
2327

2428
# source ROS workspace
29+
if [ ! -d "/home/$USER/workspaces/traversability_ws" ]; then
30+
echo "ROS workspace does not exist: /home/$USER/workspaces/traversability_ws"
31+
exit 1
32+
fi
2533
source /home/$USER/workspaces/traversability_ws/devel/setup.bash
2634

2735
# loop through bag files
2836
for SEQ in "${SEQUENCES[@]}"
2937
do
38+
if [ ! -f "${SEQ}.bag" ]; then
39+
echo "Bag file does not exist: ${SEQ}.bag"
40+
continue
41+
fi
3042
echo "Processing bag file: ${SEQ}.bag"
3143
# if husky in bag file name, use cloud topic /points
3244
if [[ $SEQ == *"husky"* ]]; then

scripts/warp/point_mass_2d_multi_experiments

-139
This file was deleted.

0 commit comments

Comments
 (0)