-
Notifications
You must be signed in to change notification settings - Fork 38
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
Full review #2
Full review #2
Conversation
Robustify against negative dt values
Make init-vel threshold tunable so users can pick a value for their application
Industrial ci
Fix backwards cancel bug and add test for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comments. Additionally, I'm curious as to what the rationale is behind the separation between the controller.cpp
file and the path_tracking_pid.cpp
file. Could you elaborate?
<rosparam file="$(find path_tracking_pid)/test/local_costmap_params.yaml" command="load" /> | ||
</node> | ||
|
||
</launch> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file tries to launch mbf_costmap_nav
from move_base_flex
, but it is not a dependency. You may not want to add a dependency on move_base_flex to this package. But instead, you could make a separate package in this repo containing this applied example and its configuration, with dependencies on path_tracking_pid
and mbf_costmap_nav
. But I'm open to alternatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or perhaps add it as a test dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been tackled by the roslaunch checker.
Should be an exec_depend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type of errors will be caught by a proper CI. Reason to set this up?
// 'Project' plan by removing z-component | ||
pose_stamped.pose.position.z = 0.0; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function above checks for compatibility of the plan's frame and the frame the controller is running in. This makes assumptions about the application. Does the user want you to control in the plan's frame, or do they want the controller to convert the plan to the controller's frame? There's no way of knowing.
Keep the the controller (and the entire ROS system) clean by assuming you're running in the standardized frames (map
, odom
, or maybe utm
or something). In this case you're using the frame specified for move_base_flex
. If the user wants to be flexible with respect to the reference frames of navigation plans, they should transform any incoming plans to the move_base_flex
global frame in a separate rosnode with the isolated functionality of providing this flexible interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a discussion about this topic on ROS2. We will check this and decide later on how to proceed.
controller_state_.current_x_vel = new_x_vel; | ||
controller_state_.current_yaw_vel = new_yaw_vel; | ||
return output_combined; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This single function is nearly 470 lines of code. Split this up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. We should probably enable sonarcloud on this repository as well. It gives indications like cyclomatic-complexity of the code. And maximum number of seperate statements in functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This refactor is in progress. Should I raise an issue about CI missing?
As I'm not the original (nor the main) author here, I didn't address all comments 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm losing confidence in the viability of this controller for the long term... It takes a complete reimplementation to fix this.
src/controller.cpp
Outdated
// When velocity error is too big reset current_x_vel | ||
if (fabs(odom_twist.linear.x - controller_state_.current_x_vel) > max_error_x_vel_) | ||
{ | ||
// TODO(clopez/mcfurry/nobleo): Give feedback to higher level software here | ||
ROS_WARN("Large control error. Current_x_vel %f / odometry %f", | ||
controller_state_.current_x_vel, odom_twist.linear.x); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"reset current_x_vel
"? I don't see this happening...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a reset at some point, but then it introduced a undesired behavior in one of the applications, we should remove or rewrite the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get rid of this condition and warning, because it is doesn't do anything functionally, and a similar check is performed in the update
method here:
path_tracking_pid/src/controller.cpp
Lines 642 to 649 in 61c6cc8
// When velocity error is too big reset current_x_vel | |
if ( | |
fabs(odom_twist.linear.x) < fabs(current_target_x_vel_) && | |
fabs(odom_twist.linear.x - new_x_vel) > config_.max_error_x_vel) { | |
// TODO(clopez/mcfurry/nobleo): Give feedback to higher level software here | |
ROS_WARN_THROTTLE( | |
1.0, "Large tracking error. Current_x_vel %f / odometry %f", new_x_vel, odom_twist.linear.x); | |
} |
|
||
// Cutoff frequency for the derivative calculation in Hz. | ||
// Negative -> Has not been set by the user yet, so use a default. | ||
double cutoff_frequency_long_ = -1.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused private field
double feedforward_ang_ = 0.0; | ||
double xvel_ = 0.0; | ||
double yvel_ = 0.0; | ||
double thvel_ = 0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused private fields xvel_
, yvel_
and thvel_
{ | ||
std::vector<polygon_t> output_vec; | ||
boost::geometry::union_(polygon1, polygon2, output_vec); | ||
return output_vec.at(0); // Only first vector element is filled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The union of two polygons can be two polygons if there is no overlap. So this funciton always throws away the second
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. We expect them to overlap though, so we should probably warn on size > 1
nh.param<std::string>("base_link_frame", base_link_frame_, "base_link"); | ||
|
||
nh.param<bool>("use_tricycle_model", use_tricycle_model_, false); | ||
nh.param<std::string>("steered_wheel_frame", steered_wheel_frame_, "steer"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these parameters not part of the dynamic reconfigure set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vehicles rarely get a fourth wheel on runtime 🙂
And frame-names are assumed to be static in ROS mostly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me the cfg file is very useful to get a quick look at which parameters are available. It would be nice if all parameters would be described in it. Even if some parameters won't change on runtime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be done, but then the code should cope with changing them.
Cleanup Controller::update().
Replaced path pose parameter with return value.
…onst Made Controller::findPositionOnPlan() const.
…-data-member Replaced distance_to_goal_ data member with local.
…ndex Moved last visited pose index to find result.
…-parameter Replaced controller_state parameter of findPositionOnPlan().
Renamed position to pose for findPositionOnPlan.
Replaced Controller::getControllerState().
…g-backwards fix: Use absolute stopping time to calculate end phase distance
Move & simplify getControlPointPose
[AStapler] converter node
The old gpl license might make us vulnerable to oudside contributers, as discussed in the tech share meeting. Let's relicense under Apache-2.0 to also address some potential patent related issues. Relicensing requires the consent of all copyright holders. I’ve tracked down all contributions, and they were all done by people working at Nobleo. This means Nobleo is the sole copyright holder.
Relicense the code under Apache-2.0
PR for commenting on the complete codebase.