Skip to content

Commit

Permalink
More cleanups
Browse files Browse the repository at this point in the history
- Removed unnecessary debugs
- Removed unnecessary TODO's
  • Loading branch information
scherererer committed Jul 19, 2017
1 parent 0c5d532 commit 73efe33
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 52 deletions.
18 changes: 0 additions & 18 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ int main()

h.onMessage([&ukf,&tools,&estimations,&ground_truth]
(uWS::WebSocket<uWS::SERVER> ws, char *data, size_t length, uWS::OpCode opCode) {
std::cout << "\n";
// "42" at the start of the message means there's a websocket message event.
// The 4 signifies a websocket message
// The 2 signifies a websocket event
Expand All @@ -55,8 +54,6 @@ int main()

auto s = hasData(std::string(data));
if (s != "") {
std::cout << "data: '" << s << "'\n";

auto j = json::parse(s);

std::string event = j[0].get<std::string>();
Expand Down Expand Up @@ -145,31 +142,16 @@ int main()
msgJson["rmse_vx"] = RMSE(2);
msgJson["rmse_vy"] = RMSE(3);
auto msg = "42[\"estimate_marker\"," + msgJson.dump() + "]";
std::cout << "Estimated state: "
<< p_x << " "
<< p_y << " "
<< v << " "
<< yaw << " "
<< v1 << " "
<< v2 << " "
<< RMSE(0) << " "
<< RMSE(1) << " "
<< RMSE(2) << " "
<< RMSE(3) << "\n";
std::cout << "telemetry: '" << msg << "'\n";
ws.send(msg.data(), msg.length(), uWS::OpCode::TEXT);

}
} else {

std::string msg = "42[\"manual\",{}]";
std::cout << "NOTELEM: '" << msg << "'\n";
ws.send(msg.data(), msg.length(), uWS::OpCode::TEXT);
}
}

std::cout << std::endl;

});

// We don't need this since we're not using HTTP but if it's removed the program
Expand Down
35 changes: 1 addition & 34 deletions src/ukf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ UKF::UKF() :
std_radphi_(0.03),
// Radar measurement noise standard deviation radius change in m/s
std_radrd_(0.3)

/**
TODO:
Complete the initialization. See ukf.h for other member properties.
Hint: one or more values initialized above might be wildly off...
*/
{
weights_(0) = lambda_ / (lambda_ + n_aug_);
for (unsigned i = 1; i < weights_.rows (); ++i)
Expand All @@ -94,13 +86,6 @@ UKF::~UKF()
*/
void UKF::ProcessMeasurement(MeasurementPackage const &meas_package)
{
/**
TODO:
Complete this function! Make sure you switch between lidar and radar
measurements.
*/

if (! is_initialized_)
{
Initialize (meas_package);
Expand Down Expand Up @@ -252,7 +237,7 @@ void UKF::Prediction(double delta_t)
noise << 0.5f * delta_t * delta_t * cos (phi) * va,
0.5f * delta_t * delta_t * sin (phi) * va,
delta_t * va,
0.5f * delta_t * delta_t * vphidd, ///< \todo not sure if I should wrap
0.5f * delta_t * delta_t * vphidd,
delta_t * vphidd;

// if phi dot is not zero
Expand Down Expand Up @@ -306,15 +291,6 @@ void UKF::Prediction(double delta_t)
*/
void UKF::UpdateLidar(MeasurementPackage const &meas_package)
{
/**
TODO:
Complete this function! Use lidar data to update the belief about the object's
position. Modify the state vector, x_, and covariance, P_.
You'll also need to calculate the lidar NIS.
*/

int constexpr n_z = 2;

VectorXd z = VectorXd (n_z);
Expand Down Expand Up @@ -393,15 +369,6 @@ void UKF::UpdateLidar(MeasurementPackage const &meas_package)
*/
void UKF::UpdateRadar(MeasurementPackage const &meas_package)
{
/**
TODO:
Complete this function! Use radar data to update the belief about the object's
position. Modify the state vector, x_, and covariance, P_.
You'll also need to calculate the radar NIS.
*/

int constexpr n_z = 3;

MatrixXd Zsig = MatrixXd(n_z, 2 * n_aug_ + 1);
Expand Down

0 comments on commit 73efe33

Please sign in to comment.