Conversation
Mark/autodrive sim integration
hepromark
left a comment
There was a problem hiding this comment.
Good initial PR! There's a concern I have about how speed is calculated, but your logic is sound
| EmergencyBraking() : Node("emergency_braking_node") { | ||
| brake_pub_ = this->create_publisher<ackermann_msgs::msg::AckermannDriveStamped>("drive", 10); | ||
| scan_sub_ = this->create_subscription<sensor_msgs::msg::LaserScan>("scan", 10, std::bind(&EmergencyBraking::scan_callback, this, _1)); | ||
| odom_sub_ = this->create_subscription<nav_msgs::msg::Odometry>("ego_racecar/odom", 10, std::bind(&EmergencyBraking::odom_callback, this, _1)); |
There was a problem hiding this comment.
I think relying on odom here isn't a good idea:
The ego_racecar/odom reading is only "100% accurate" in simulation, in real-life the SLAM subteam computes odom estimates. This mean that the data you're using for emergency braking may be unreliable depending on how good SLAM is, which is spooky because if something goes wrong in SLAM the emergency braking would also not work properly.
The idea is that emergency braking acts as a "standalone last resort" component which kicks in regardless of what any of the other components are saying. So I think it's a better idea to only use lidar readings.
I.e. instead of getting speed from the odom reading, you can calculate the speed using how the lidar measurements change over time.
If this doesn't make sense then you can just ping me on the server and we can hop in a call / I can clarify further! Sorry about the confusion, but this is arguably the most important part in the system so that we don't wreck our car :)) Thanks for your work!
| # Install the meshes folder | ||
| #install(DIRECTORY assets/ | ||
| # DESTINATION share/${PROJECT_NAME}/assets | ||
| #) |
There was a problem hiding this comment.
| # Install the meshes folder | |
| #install(DIRECTORY assets/ | |
| # DESTINATION share/${PROJECT_NAME}/assets | |
| #) |
| void scan_callback(const sensor_msgs::msg::LaserScan::ConstSharedPtr scan_msg) { | ||
| // calculate TTC | ||
| bool brake = false; | ||
| double threshold = 1; |
There was a problem hiding this comment.
S: Make this a class constant. Itll be easier to find & tweak in the future if we need this to be more/less conservative.
@hepromark