-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from FS-Online/ground-speed-sensor
Ground speed sensor
- Loading branch information
Showing
18 changed files
with
221 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef msr_airlib_GSSSimple_hpp | ||
#define msr_airlib_GSSSimple_hpp | ||
|
||
|
||
#include "sensors/SensorBase.hpp" | ||
|
||
|
||
namespace msr { namespace airlib { | ||
|
||
class GSSSimple : public SensorBase { | ||
public: | ||
// Ground Speed Sensor | ||
GSSSimple(const std::string& sensor_name = "") | ||
: SensorBase(sensor_name) | ||
{} | ||
|
||
public: | ||
struct Output { | ||
TTimePoint time_stamp; | ||
Vector3r linear_velocity; | ||
}; | ||
|
||
public: | ||
virtual void update() override | ||
{ | ||
Output output; | ||
const GroundTruth& ground_truth = getGroundTruth(); | ||
|
||
output.time_stamp = clock()->nowNanos(); | ||
output.linear_velocity = Vector3r(std::sqrt(std::pow(ground_truth.kinematics->twist.linear.x(), 2) + std::pow(ground_truth.kinematics->twist.linear.y(), 2)), 0, ground_truth.kinematics->twist.linear.z()); | ||
|
||
output_ = output; | ||
} | ||
const Output& getOutput() const | ||
{ | ||
return output_; | ||
} | ||
|
||
virtual ~GSSSimple() = default; | ||
|
||
virtual void resetImplementation() override { | ||
|
||
} | ||
|
||
private: | ||
Output output_; | ||
}; | ||
|
||
|
||
}} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Ground Speed Sensor (GSS) | ||
|
||
The ground speed sensor is modeled around the Kistler ground speed (like the Kistler Correvit SFII). | ||
|
||
Velocity information is captured in the frame of the car in the NED frame. | ||
|
||
At this moment no extra noise is added to the sensordata since the kistler 250hz data averaged into the 100hz is so close to ground truth that adding noise would be unrealistic. | ||
|
||
## Ros | ||
When using the ros bridge, ground speed sensordata will be published on `/fsds/gss` with the `geometry_msgs/TwistStamped` message type. | ||
|
||
Appart from the header fields, only `x` and `z` of the `twist.linear` are populated. | ||
All other values will be 0. | ||
|
||
``` | ||
header: | ||
seq: 5747 | ||
stamp: | ||
secs: 1595325426 | ||
nsecs: 617730500 | ||
frame_id: "fsds/FSCar" | ||
twist: | ||
linear: | ||
x: 4.80838251114 | ||
y: -0.0 | ||
z: -0.0214105024934 | ||
angular: | ||
x: 0.0 | ||
y: 0.0 | ||
z: 0.0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.