Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/open planner dev #1400

Merged
merged 21 commits into from
Aug 23, 2018
Merged

Feature/open planner dev #1400

merged 21 commits into from
Aug 23, 2018

Conversation

hatem-darweesh
Copy link

@hatem-darweesh hatem-darweesh commented Jul 27, 2018

Status

** DEVELOPMENT**

Description

Add OpenPlanner new Modifications and Tools to Autoware develop branch.

  • OpenPlanner - Global Planner
  • OpenPlanner - Local Planner
  • OpenPlanner - Utilities
  • OpenPlanner - Simulator
  • lidar_kf_contour_track
    Remove Old OpenPlanner (dp_planner, way_planner)
    Add readme for each module

**For More Details about the updated OpenPlanner, interface description and how to test **
OpenPlanner Nodes.pdf

Steps to Test or Reproduce

  • Should produce same behaviour as previous (way_planner, dp_planner).
  • Should show same output as Demo Video
  • Basic Functions To Test:
  1. OpenPlanner - Global planner should load map successfully and generate global path from start to goal points specified by rviz or from .csv file.
  2. OpenPlanner - Local Planner should generate local trajectories along the global path, follow other simulated vehicles, avoid obstacles, stop for stop lines, and stop in traffic lights if light is red.
  3. OpenPlanner - Utilities should be able to play rosbag file including localization, pause, play backwards, and publish TF for ndt_pose
  4. OpenPlanner - Simulator should simulate a vehicle moving with specific speed from start to goal position, simulate simple intersection traffic lights, and simulate perception by generating cloud_clusters for simulate vehicles.
  5. lidar_kf_contour_track should track detected objects, find heading and velocity for objects detected by lidar_euclidean_cluster or op_perception_simulator.

Follow README files and Demo Video

Update ring ground filter with latest implementation
Update lidar_kf_contour_track with latest implementation
Add op_utilities nodes (op_bag_player, op_data_logger, op_pose2tf)
Modify autoware_msgs for OpenPlanner use (CloudCluster, DetectedObject, lane, waypoint)
Update UI computing.yaml for the new nodes and modifies parameters
Update UI sensing.yaml for updated ring_ground_filter params
Update MappingHelpers with latest modifications
Update PlanningHelpers with latest modifications
add op_common_param node, for setting OpenPlanner parameter for all related nodes such as lidar_kf_contour_track
Improve tracking by including size different in association function
Update way_planner, dp_planner for compatibility with new Mapping Modifications, Map format is backward compatible
Fix Global Planning function for the new map modification
Add OpenPlanner Simulator for perception, traffic lights, cars
Add OpenPlanner new version to replace wp_planner and dp_planner
Remove unnecessary files from OpenPlanner libraries
Test Global and Local planning
Test Tracking node (kf_contour_track)
Test Simulation Nodes
Test Utility Nodes
… map messages, old behavior still works but from launch file only.

Delete way_planner, dp_planner from UI, but they still accessible from roslaunch.
Fix Simulated Vehicle Initialization
Test Following
Test Obstacle Avoidance
Add Visualization information to rviz config file open_planner.rviz
desc : Simulate traffic Signs status for intersections included in the map
cmd : roslaunch op_simulation_package op_signs_simulator.launch
param: op_signs_simulator
- name : op_car_simulator_1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hatem-darweesh There are 5 checkboxes for op_car_simulator. This should be only one here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hatem-darweesh How about @kitsukawa's comment?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kitsukawa @kfunaoka Only 1 check box for simulated car remaining, I will add multi car simulation option in "Simulation" tab later.

Copy link

@kfunaoka kfunaoka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hatem-darweesh I've added some comments, but it is difficult to review whole because the diff is very wide range. Would you list reasons why these changes are necessary for each items with comparing with the old implementation?

  • OpenPlanner - Global planner
  • OpenPlanner - Local Planner
  • OpenPlanner - Utilities
  • OpenPlanner - Simulator
  • lidar_kf_contour_track

)


set(CMAKE_CXX_FLAGS "-O2 -Wall ${CMAKE_CXX_FLAGS}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this deletion intended?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw a PR which adds common compiler flags to all cmake files "autoware_build_flags". so I deleted the special ones

Copy link

@kfunaoka kfunaoka Aug 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I should accomplish autoware_build_flags because it sets only -std=c++11 now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other flags are needed only locally for debugging and performance test so I don't want to push them to the server

@@ -0,0 +1,95 @@

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to distribute this file under BSD 3-Clause "New" or "Revised" License?
If yes, please insert the license terms.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you give me an example to follow.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlannerHNS::WayPoint max_from_center;
bool bFirst;

QuarterView(const int& min_a, const int& max_a, const int& index)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to use int or const int instead of const int&.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is less confusing to use one parameter format for both objects and standard types.
and it will be really dangerous and will take plenty of time and testing to change it through the whole OpenPlanner library.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think so too in the point of view where it takes much time and dangerous. I think it is better to be as is in this pull request.

But using const int & instead of int simply incurs piled-up overhead. I think C++ programmers do not confuse about it because they should know C and C++ basically employs pass by value.


bool UpdateQuarterView(const PlannerHNS::WayPoint& v)
{
if(v.pos.a <= min_ang || v.pos.a > max_ang)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that clang-format was not used. Did you use clang-format? If no, please use clang-format to all the files you modified. (https://github.com/CPFL/Autoware/wiki/Contribution-Rules#ros-c-coding)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will apply it later with different PR, after merging this one.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hatem-darweesh Your choice is the best method.

namespace ContourTrackerNS
{

#define DEBUG_TRACKER 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use constexpr instead of #define. (https://en.cppreference.com/w/cpp/language/constexpr)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this as ToDo, I need to check for each #define whether it is a compiler directive or a constant. so it will take long time.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f.pTrack->UpdatePathAndIndex(obj.predTrajectories.at(f.new_index), f.new_index);

bool bFound = false;
for(unsigned int k=0; k < check_list.size(); k++)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use standard functions. It seems that this loop can be replaced by std::find.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personal preference

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hatem-darweesh NP. But std::find can reduce the number of lines 1/9 (one ninth) where we develop, review, and maintain. If there are ten loops finding an element, it can reduce 81 (= 90 - 9) lines in the Autoware code base. If you like it, please use it :)

  • The number of lines of this loop is 9 (from Line 688 to 695).
  • The number of lines of std::find is 1.


std::vector<PlannerHNS::GPSPoint> PolygonGenerator::EstimateClusterPolygon(const pcl::PointCloud<pcl::PointXYZ>& cluster, const PlannerHNS::GPSPoint& original_centroid, PlannerHNS::GPSPoint& new_centroid, const double& polygon_resolution)
{
for(unsigned int i=0; i < m_Quarters.size(); i++)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personal preference

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as #1400 (comment)


#ifndef PLANNINGHELPERS_H_
#define PLANNINGHELPERS_H_

#include <math.h>
//#include <math.h>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be deleted. Unnecessary comments will be junk.

}
}

int BehaviorPrediction::FromIndicatorToNumber(const PlannerHNS::LIGHT_INDICATOR& indi)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are FromIndicatorToNumber and FromNumbertoIndicator necessary? Is it impossible to use enum value itself?

Copy link
Author

@hatem-darweesh hatem-darweesh Aug 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the compiler give me an error casting from int to the enumerator, so I create a function to convert from one to another and the vice versa , just to be consistent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hatem-darweesh Is it just a design problem or an unavoidable problem? Basically, it seems that it is not a good idea to have the same type of data (Particle::indicator and the data returned from BehaviorPrediction::FromNumbertoIndicator) with different types (int and lannerHNS::LIGHT_INDICATOR, respectively).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Particle::indicator is defined as int in autoware_msgs::DetectedObject. It is difficult to avoid.

double BehaviorPrediction::CalcIndicatorWeight(PlannerHNS::LIGHT_INDICATOR p_ind, PlannerHNS::LIGHT_INDICATOR obj_ind)
{
if((obj_ind == PlannerHNS::INDICATOR_LEFT || obj_ind == PlannerHNS::INDICATOR_RIGHT || obj_ind == PlannerHNS::INDICATOR_NONE) && p_ind == obj_ind)
return 0.99;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove magic numbers as much as possible.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part (Prediction) is under development (research work) , all numbers will be removed or added as parameters soon.

@kfunaoka
Copy link

@hatem-darweesh My comments are general principles. Would you try to apply the principles to the other places?

<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<buildtool_depend>catkin</buildtool_depend>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add buildtool_depend of autoware_build_flags.
https://github.com/CPFL/Autoware/wiki/Quality-Control

<version>0.0.1</version>
<description>The OpenPlanner Global Planning package</description>

<!-- One maintainer tag required, multiple allowed, one person per tag -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete unnecessary comments.

project(op_global_planner)

find_package(catkin REQUIRED COMPONENTS
geometry_msgs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kfunaoka kfunaoka closed this Aug 15, 2018
@kfunaoka kfunaoka reopened this Aug 15, 2018
@kfunaoka
Copy link

Sorry for mistake.

It's better to use clang format after all codes are reviewed because it make the history unreadable.

pass pointer as "const" for function "DeleteFromList" in both (BehaviorPrediction and LLP) classes
Delete useless comment for including math.h
Copy link

@kfunaoka kfunaoka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hatem-darweesh Though I've made a lot of comments, my mandatory requests now are:

  • Inserting license information into *.{h,cpp} files as mentioned at Feature/open planner dev #1400 (comment).
  • Inserting autoware_build_flags into package.xml and CMakeLists.txt as shown at Feature/open planner dev #1400 (review)
  • Updating the headline of this pull request to show what are different from before and why they are necessary. Your slide and descriptions will help us to understand your work.

@kfunaoka
Copy link

@hatem-darweesh Your work is great. To approve this pull request, please be reviewed by aohsato from other aspects. I think I am not the best person who reviews this pull request.

In your future work, it's better to make pull requests as accordingly-small as possible. Stepwise pull requests will help reviewers. Enough review will improve your work more and more. I think small feedback loop is better than large feedback loop for you and for reviews.

@kfunaoka
Copy link

I've added the following item into my review comment (#1400 (review)).

…esting

Only one simulated car available in the runtime manager
update for copywrite note
insert autoware_build_flags to new nodes
@hatem-darweesh
Copy link
Author

@kfunaoka can you check your review comments and current changes.

Copy link

@kfunaoka kfunaoka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hatem-darweesh I've confirmed that all my mandatory request are OK. I might find an item that you want to change.

)


set(CMAKE_CXX_FLAGS "-O2 -Wall ${CMAKE_CXX_FLAGS}")
find_package(OpenCV REQUIRED)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- set(CMAKE_CXX_FLAGS "-O2 -Wall ${CMAKE_CXX_FLAGS}")

Should we revert this line because you said

The other flags are needed only locally for debugging and performance test so I don't want to push them to the server

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kfunaoka I will add to different PR if necessary

@kfunaoka kfunaoka dismissed their stale review August 22, 2018 05:52

All my mandatory request are OK

@hatem-darweesh hatem-darweesh merged commit 875625a into develop Aug 23, 2018
@hatem-darweesh hatem-darweesh deleted the feature/OpenPlanner-dev branch August 23, 2018 03:06
@kfunaoka kfunaoka mentioned this pull request Sep 6, 2018
2 tasks
anubhavashok pushed a commit to NuronLabs/autoware.ai that referenced this pull request Sep 7, 2021
@mitsudome-r mitsudome-r added the version:autoware-ai Autoware.AI label Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants