Skip to content

Commit da8c291

Browse files
committed
Fix replay
1 parent d775594 commit da8c291

File tree

5 files changed

+23
-25
lines changed

5 files changed

+23
-25
lines changed

adaptive_snowsampler/include/adaptive_snowsampler/adaptive_snowsampler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ class AdaptiveSnowSampler {
227227

228228
Eigen::Vector3d vehicle_position_{Eigen::Vector3d(0.0, 0.0, 0.0)};
229229
Eigen::Vector3d lv03_vehicle_position_{Eigen::Vector3d(0.0, 0.0, 0.0)};
230-
Eigen::Vector3d map_origin_{Eigen::Vector3d{0.0, 0.0, 0.0}};
230+
Eigen::Vector3d map_origin_{Eigen::Vector3d{787802.0, 185985.0, 0.0}}; //Fluelatal
231+
// Eigen::Vector3d map_origin_{Eigen::Vector3d{783936.0, 184512.0, 0.0}}; //Braemabuel
231232
std::vector<geometry_msgs::PoseStamped> positionhistory_vector_;
232233
Eigen::Quaterniond vehicle_attitude_{Eigen::Quaterniond(1.0, 0.0, 0.0, 0.0)};
233234
boost::circular_buffer<Eigen::Vector3d> vehicle_attitude_buffer_{20};

adaptive_snowsampler/launch/replay_bag.launch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<launch>
2+
<!-- <arg name="location" default="flueelatal"/> -->
23
<arg name="location" default="braemabuel_1m_crop"/>
34
<arg name="path" default="$(find adaptive_snowsampler)/scripts/file.bag"/>
45
<arg name="visualization" default="true"/>

adaptive_snowsampler/scripts/log_replay.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def convert_ulog2rosbag(path, rosbag_file_name, messages, disable_str_exceptions
110110
list.sort()
111111

112112
for filename in list:
113+
if os.path.isdir(os.path.join(path, filename)):
114+
continue
113115
print(filename)
114116
appendBag(os.path.join(path, filename), bag)
115117
else:

adaptive_snowsampler/src/adaptive_snowsampler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@ AdaptiveSnowSampler::AdaptiveSnowSampler(const ros::NodeHandle &nh, const ros::N
139139
}
140140

141141
void AdaptiveSnowSampler::cmdloopCallback(const ros::TimerEvent &event) {
142-
if (global_position_received_) {
143-
publishPositionHistory(referencehistory_pub_, vehicle_position_, positionhistory_vector_);
144-
}
145142
publishVehiclePose(vehicle_pose_pub_, vehicle_position_, vehicle_attitude_);
146143
}
147144

@@ -265,7 +262,7 @@ void AdaptiveSnowSampler::publishMap() {
265262
Eigen::Vector3d map_origin;
266263
map_->getGlobalOrigin(epsg, map_origin);
267264
map_origin_ = map_origin;
268-
265+
std::cout << "map_origin: " << map_origin_.transpose() << std::endl;
269266
grid_map_geo_msgs::GeographicMapInfo map_info_msg;
270267
map_info_msg.header.stamp = ros::Time::now();
271268
map_info_msg.geo_coordinate = static_cast<int>(epsg);
@@ -340,6 +337,9 @@ void AdaptiveSnowSampler::vehicleGlobalPositionCallback(const sensor_msgs::NavSa
340337

341338
// Send the transformation
342339
// tf_broadcaster_->sendTransform(t);
340+
if (global_position_received_) {
341+
publishPositionHistory(referencehistory_pub_, vehicle_position_, positionhistory_vector_);
342+
}
343343
}
344344
// void AdaptiveSnowSampler::distanceSensorCallback(const px4_msgs::DistanceSensor &msg) {
345345
// lidar_distance_ = msg.current_distance;

snowsampler_rviz/launch/config.rviz

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ Panels:
3434
SyncSource: ""
3535
- Class: snowsampler_rviz/PlanningPanel
3636
Name: PlanningPanel
37-
namespace: ""
38-
odometry_topic: ""
39-
planner_name: ""
40-
planning_budget: 100.0
4137
Preferences:
4238
PromptSaveOnExit: true
4339
Toolbars:
@@ -69,14 +65,11 @@ Visualization Manager:
6965
Color: 200; 200; 200
7066
Color Layer: color
7167
Color Transformer: ColorLayer
72-
ColorMap: default
7368
Enabled: true
74-
Grid Cell Decimation: 1
75-
Grid Line Thickness: 0.10000000149011612
7669
Height Layer: elevation
7770
Height Transformer: GridMapLayer
7871
History Length: 1
79-
Invert ColorMap: false
72+
Invert Rainbow: false
8073
Max Color: 255; 255; 255
8174
Max Intensity: 10
8275
Min Color: 0; 0; 0
@@ -85,7 +78,7 @@ Visualization Manager:
8578
Show Grid Lines: false
8679
Topic: /elevation_map
8780
Unreliable: false
88-
Use ColorMap: true
81+
Use Rainbow: true
8982
Value: true
9083
- Alpha: 1
9184
Buffer Length: 1
@@ -125,31 +118,32 @@ Visualization Manager:
125118
Marker Topic: /home_position
126119
Name: Marker
127120
Namespaces:
128-
{}
121+
sphere: true
129122
Queue Size: 100
130123
Value: true
131124
- Class: rviz/Marker
132125
Enabled: true
133126
Marker Topic: /setpoint_position
134127
Name: Marker
135128
Namespaces:
136-
{}
129+
sphere: true
137130
Queue Size: 100
138131
Value: true
139132
- Class: rviz/Marker
140133
Enabled: true
141134
Marker Topic: /target_normal
142135
Name: Marker
143136
Namespaces:
144-
{}
137+
arrow: true
145138
Queue Size: 100
146139
Value: true
147140
- Class: rviz/MarkerArray
148141
Enabled: true
149142
Marker Topic: /vehicle_pose_marker
150143
Name: MarkerArray
151144
Namespaces:
152-
{}
145+
body: true
146+
leg: true
153147
Queue Size: 100
154148
Value: true
155149
Enabled: true
@@ -180,25 +174,25 @@ Visualization Manager:
180174
Views:
181175
Current:
182176
Class: rviz/Orbit
183-
Distance: 242.64480590820312
177+
Distance: 273.07568359375
184178
Enable Stereo Rendering:
185179
Stereo Eye Separation: 0.05999999865889549
186180
Stereo Focal Distance: 1
187181
Swap Stereo Eyes: false
188182
Value: false
189183
Field of View: 0.7853981852531433
190184
Focal Point:
191-
X: 15.703259468078613
192-
Y: 103.41791534423828
193-
Z: 1887.617431640625
185+
X: -73.24365234375
186+
Y: 107.97415924072266
187+
Z: 2238.623291015625
194188
Focal Shape Fixed Size: true
195189
Focal Shape Size: 0.05000000074505806
196190
Invert Z Axis: false
197191
Name: Current View
198192
Near Clip Distance: 0.009999999776482582
199-
Pitch: 0.5903987884521484
193+
Pitch: 0.2403990477323532
200194
Target Frame: <Fixed Frame>
201-
Yaw: 5.393568515777588
195+
Yaw: 1.540382981300354
202196
Saved: ~
203197
Window Geometry:
204198
Displays:
@@ -219,4 +213,4 @@ Window Geometry:
219213
collapsed: false
220214
Width: 1386
221215
X: 432
222-
Y: 82
216+
Y: 45

0 commit comments

Comments
 (0)