Skip to content

Commit a4c1a64

Browse files
author
henrykotze
committed
Update to datum position
Signed-off-by: henrykotze <[email protected]>
1 parent f221601 commit a4c1a64

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/AirFlowSensor.cc

+6-11
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ bool AirFlowSensor::Update(
174174
math::Vector3d air_vel_in_body_ = this->dataPtr->vel -
175175
veh_q_world_to_body.RotateVectorReverse(wind_vel_);
176176

177+
// airflow flowing in to the sensor is measured as 0. Hense the substraction
178+
// of M_2_PI.
177179
double airflow_direction_in_xy_plane = atan2f(air_vel_in_body_.Y(),
178-
air_vel_in_body_.X());
180+
air_vel_in_body_.X()) - M_PI_2;
179181

180182
// Apply noise
181183
if (this->dataPtr->dir_noises.find(AIR_FLOW_DIR_NOISE) !=
@@ -187,9 +189,6 @@ bool AirFlowSensor::Update(
187189
msg.mutable_direction_noise()->set_type(msgs::SensorNoise::GAUSSIAN);
188190
}
189191

190-
// apply resolution to sensor measurement
191-
192-
193192
air_vel_in_body_.Z() = 0;
194193
double airflow_speed = air_vel_in_body_.Length();
195194

@@ -199,16 +198,12 @@ bool AirFlowSensor::Update(
199198
{
200199
airflow_speed =
201200
this->dataPtr->speed_noises[AIR_FLOW_SPEED_NOISE]->Apply(
202-
airflow_direction_in_xy_plane);
201+
airflow_speed);
203202
msg.mutable_speed_noise()->set_type(msgs::SensorNoise::GAUSSIAN);
204203
}
205204

206-
// apply resolution to sensor measurement
207-
208-
209-
210-
msg.set_xy_speed(airflow_direction_in_xy_plane);
211-
msg.set_xy_direction(airflow_speed);
205+
msg.set_xy_direction(airflow_direction_in_xy_plane);
206+
msg.set_xy_speed(airflow_speed);
212207

213208
// publish
214209
this->AddSequence(msg.mutable_header());

0 commit comments

Comments
 (0)