Skip to content

Commit

Permalink
refactor(accel_brake_map_calibrator)!: add autoware_ prefix (#7351)
Browse files Browse the repository at this point in the history
* add prefix to the codes

Signed-off-by: Yuki Takagi <[email protected]>

change dir name

Signed-off-by: Yuki Takagi <[email protected]>

update

Signed-off-by: Yuki Takagi <[email protected]>

update

Signed-off-by: Yuki Takagi <[email protected]>

* delete debug

Signed-off-by: Yuki Takagi <[email protected]>

* fix format

Signed-off-by: Yuki Takagi <[email protected]>

* fix format

Signed-off-by: Yuki Takagi <[email protected]>

* restore

Signed-off-by: Yuki Takagi <[email protected]>

* poi

Signed-off-by: Yuki Takagi <[email protected]>

---------

Signed-off-by: Yuki Takagi <[email protected]>
  • Loading branch information
yuki-takagi-66 authored Jun 10, 2024
1 parent 140cef9 commit e57e9f1
Show file tree
Hide file tree
Showing 40 changed files with 39 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ system/system_monitor/** [email protected] [email protected]
system/topic_state_monitor/** [email protected]
system/velodyne_monitor/** [email protected]
tools/reaction_analyzer/** [email protected]
vehicle/accel_brake_map_calibrator/** [email protected] [email protected] [email protected]
vehicle/autoware_steer_offset_estimator/** [email protected]
vehicle/autoware_accel_brake_map_calibrator/** [email protected] [email protected] [email protected]
vehicle/external_cmd_converter/** [email protected]
vehicle/autoware_raw_vehicle_cmd_converter/** [email protected] [email protected] [email protected]
vehicle/autoware_steer_offset_estimator/** [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "autoware_crosswalk_traffic_light_estimator/node.hpp"
#include "crosswalk_traffic_light_estimator/node.hpp"

#include <lanelet2_extension/regulatory_elements/Forward.hpp>
#include <lanelet2_extension/utility/message_conversion.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(accel_brake_map_calibrator)
project(autoware_accel_brake_map_calibrator)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ The base map, which is lexus's one by default, is updated iteratively with the l

### Launch Calibrator

After launching Autoware, run the `accel_brake_map_calibrator` by the following command and then perform autonomous driving. Note: You can collect data with manual driving if it is possible to use the same vehicle interface as during autonomous driving (e.g. using a joystick).
After launching Autoware, run the `autoware_accel_brake_map_calibrator` by the following command and then perform autonomous driving. Note: You can collect data with manual driving if it is possible to use the same vehicle interface as during autonomous driving (e.g. using a joystick).

```sh
ros2 launch accel_brake_map_calibrator accel_brake_map_calibrator.launch.xml rviz:=true
ros2 launch autoware_accel_brake_map_calibrator accel_brake_map_calibrator.launch.xml rviz:=true
```

Or if you want to use rosbag files, run the following commands.

```sh
ros2 launch accel_brake_map_calibrator accel_brake_map_calibrator.launch.xml rviz:=true use_sim_time:=true
ros2 launch autoware_accel_brake_map_calibrator accel_brake_map_calibrator.launch.xml rviz:=true use_sim_time:=true
ros2 bag play <rosbag_file> --clock
```

During the calibration with setting the parameter `progress_file_output` to true, the log file is output in [directory of *accel_brake_map_calibrator*]/config/ . You can also see accel and brake maps in [directory of *accel_brake_map_calibrator*]/config/accel_map.csv and [directory of *accel_brake_map_calibrator*]/config/brake_map.csv after calibration.
During the calibration with setting the parameter `progress_file_output` to true, the log file is output in [directory of *autoware_accel_brake_map_calibrator*]/config/ . You can also see accel and brake maps in [directory of *autoware_accel_brake_map_calibrator*]/config/accel_map.csv and [directory of *autoware_accel_brake_map_calibrator*]/config/brake_map.csv after calibration.

### Calibration plugin

Expand Down Expand Up @@ -86,7 +86,7 @@ The process of calibration can be visualized as below. Since these scripts need
The following command shows the plot of used data in the calibration. In each plot of velocity ranges, you can see the distribution of the relationship between pedal and acceleration, and raw data points with colors according to their pitch angles.

```sh
ros2 run accel_brake_map_calibrator view_plot.py
ros2 run autoware_accel_brake_map_calibrator view_plot.py
```

![sample pic](media/log_sample.png)
Expand All @@ -102,7 +102,7 @@ The following command shows the statistics of the calibration:
of all data in each map cell.

```sh
ros2 run accel_brake_map_calibrator view_statistics.py
ros2 run autoware_accel_brake_map_calibrator view_statistics.py
```

![sample pic2](media/statistics_sample.png)
Expand Down Expand Up @@ -141,7 +141,7 @@ You can also save accel and brake map in the default directory where Autoware re
| pedal_accel_graph_output | bool | if true, it will output a log of the pedal accel graph. | true |
| progress_file_output | bool | if true, it will output a log and csv file of the update process. | false |
| default_map_dir | str | directory of default map | [directory of *autoware_raw_vehicle_cmd_converter*]/data/default/ |
| calibrated_map_dir | str | directory of calibrated map | [directory of *accel_brake_map_calibrator*]/config/ |
| calibrated_map_dir | str | directory of calibrated map | [directory of *autoware_accel_brake_map_calibrator*]/config/ |
| update_hz | double | hz for update | 10.0 |

## Algorithm Parameters
Expand Down Expand Up @@ -176,9 +176,9 @@ These scripts are useful to test for accel brake map calibration. These generate
The `accel/brake_tester.py` receives a target accel/brake command from CLI. It sends a target value to `actuation_cmd_publisher.py` which generates the `ActuationCmd`. You can run these scripts by the following commands in the different terminals, and it will be as in the screenshot below.

```bash
ros2 run accel_brake_map_calibrator accel_tester.py
ros2 run accel_brake_map_calibrator brake_tester.py
ros2 run accel_brake_map_calibrator actuation_cmd_publisher.py
ros2 run autoware_accel_brake_map_calibrator accel_tester.py
ros2 run autoware_accel_brake_map_calibrator brake_tester.py
ros2 run autoware_accel_brake_map_calibrator actuation_cmd_publisher.py
```

![actuation_cmd_publisher_util](./media/actuation_cmd_publisher_util.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//

#ifndef ACCEL_BRAKE_MAP_CALIBRATOR__ACCEL_BRAKE_MAP_CALIBRATOR_NODE_HPP_
#define ACCEL_BRAKE_MAP_CALIBRATOR__ACCEL_BRAKE_MAP_CALIBRATOR_NODE_HPP_
#ifndef AUTOWARE_ACCEL_BRAKE_MAP_CALIBRATOR__ACCEL_BRAKE_MAP_CALIBRATOR_NODE_HPP_
#define AUTOWARE_ACCEL_BRAKE_MAP_CALIBRATOR__ACCEL_BRAKE_MAP_CALIBRATOR_NODE_HPP_

#include "autoware_raw_vehicle_cmd_converter/accel_map.hpp"
#include "autoware_raw_vehicle_cmd_converter/brake_map.hpp"
Expand Down Expand Up @@ -53,7 +53,7 @@
#include <string>
#include <vector>

namespace accel_brake_map_calibrator
namespace autoware::accel_brake_map_calibrator
{

using autoware::raw_vehicle_cmd_converter::AccelMap;
Expand Down Expand Up @@ -376,6 +376,6 @@ class AccelBrakeMapCalibrator : public rclcpp::Node
explicit AccelBrakeMapCalibrator(const rclcpp::NodeOptions & node_options);
};

} // namespace accel_brake_map_calibrator
} // namespace autoware::accel_brake_map_calibrator

#endif // ACCEL_BRAKE_MAP_CALIBRATOR__ACCEL_BRAKE_MAP_CALIBRATOR_NODE_HPP_
#endif // AUTOWARE_ACCEL_BRAKE_MAP_CALIBRATOR__ACCEL_BRAKE_MAP_CALIBRATOR_NODE_HPP_
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<arg name="accel_brake_map_calib_param" default="$(find-pkg-share accel_brake_map_calibrator)/config/accel_brake_map_calibrator.param.yaml"/>
<arg name="accel_brake_map_calib_param" default="$(find-pkg-share autoware_accel_brake_map_calibrator)/config/accel_brake_map_calibrator.param.yaml"/>
<arg name="csv_default_map_dir" default="$(find-pkg-share autoware_raw_vehicle_cmd_converter)/data/default/"/>
<arg name="csv_calibrated_map_dir" default="$(find-pkg-share accel_brake_map_calibrator)/config/"/>
<arg name="csv_calibrated_map_dir" default="$(find-pkg-share autoware_accel_brake_map_calibrator)/config/"/>
<arg name="logger_level" default="info"/>
<arg name="rviz" default="true"/>
<arg name="pedal_accel_graph_output" default="true"/>
Expand All @@ -11,7 +11,7 @@
<arg name="calibration_method" default="each_cell"/>

<!-- calibration interface -->
<node pkg="accel_brake_map_calibrator" exec="accel_brake_map_calibrator" name="accel_brake_map_calibrator" output="screen">
<node pkg="autoware_accel_brake_map_calibrator" exec="accel_brake_map_calibrator" name="accel_brake_map_calibrator" output="screen">
<param from="$(var accel_brake_map_calib_param)"/>
<remap from="~/input/velocity" to="/vehicle/status/velocity_status"/>
<remap from="~/input/steer" to="/vehicle/status/steering_status"/>
Expand All @@ -20,16 +20,16 @@
<remap from="~/input/update_map_dir" to="~/update_map_dir"/>
<param name="csv_default_map_dir" value="$(var csv_default_map_dir)"/>
<param name="csv_calibrated_map_dir" value="$(var csv_calibrated_map_dir)"/>
<param name="output_log_file" value="$(find-pkg-share accel_brake_map_calibrator)/config/log.csv"/>
<param name="output_log_file" value="$(find-pkg-share autoware_accel_brake_map_calibrator)/config/log.csv"/>
<param name="pedal_accel_graph_output" value="$(var pedal_accel_graph_output)"/>
<param name="progress_file_output" value="$(var progress_file_output)"/>
<param name="use_sim_time" value="$(var use_sim_time)"/>
</node>

<!-- calibration plot and map server node -->
<node pkg="accel_brake_map_calibrator" exec="new_accel_brake_map_server.py" name="new_accel_brake_map_server" output="screen">
<node pkg="autoware_accel_brake_map_calibrator" exec="new_accel_brake_map_server.py" name="new_accel_brake_map_server" output="screen">
<param name="calibration_method" value="$(var calibration_method)"/>
</node>
<!-- Rviz -->
<node pkg="rviz2" exec="rviz2" name="rviz2" output="screen" args="-d $(find-pkg-share accel_brake_map_calibrator)/rviz/occupancy.rviz" if="$(var rviz)"/>
<node pkg="rviz2" exec="rviz2" name="rviz2" output="screen" args="-d $(find-pkg-share autoware_accel_brake_map_calibrator)/rviz/occupancy.rviz" if="$(var rviz)"/>
</launch>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>accel_brake_map_calibrator</name>
<name>autoware_accel_brake_map_calibrator</name>
<version>0.1.0</version>
<description>The accel_brake_map_calibrator</description>
<maintainer email="[email protected]">Tomoya Kimura</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DelayEstimator(Node):
def __init__(self):
# get parameter
super().__init__("delay_estimator")
package_path = get_package_share_directory("accel_brake_map_calibrator")
package_path = get_package_share_directory("autoware_accel_brake_map_calibrator")
self.declare_parameter("log_file", package_path + "/config/log.csv")
log_file = self.get_parameter("log_file").get_parameter_value().string_value
self.declare_parameter("velocity_min_threshold", 0.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self):
.string_value
)

package_path = get_package_share_directory("accel_brake_map_calibrator")
package_path = get_package_share_directory("autoware_accel_brake_map_calibrator")
self.declare_parameter(
"/accel_brake_map_calibrator/csv_calibrated_map_dir", package_path + "/config/"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self, args):
)

if calibrated_map_dir is None:
package_path = get_package_share_directory("accel_brake_map_calibrator")
package_path = get_package_share_directory("autoware_accel_brake_map_calibrator")
self.declare_parameter(
"/accel_brake_map_calibrator/csv_calibrated_map_dir", package_path + "/config/"
)
Expand Down Expand Up @@ -269,7 +269,7 @@ def main(args=None):


if __name__ == "__main__":
package_path = get_package_share_directory("accel_brake_map_calibrator")
package_path = get_package_share_directory("autoware_accel_brake_map_calibrator")
parser = argparse.ArgumentParser()
parser.add_argument(
"-d", "--default-map-dir", default=None, type=str, help="directory of default map"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ViewPlot(Node):
def __init__(self):
super().__init__("statistics_viewer")
# get parameter
package_path = get_package_share_directory("accel_brake_map_calibrator")
package_path = get_package_share_directory("autoware_accel_brake_map_calibrator")
self.declare_parameter("log_file", package_path + "/config/log.csv")
log_file = self.get_parameter("log_file").get_parameter_value().string_value
self.declare_parameter("velocity_min_threshold", 0.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.
//

#include "accel_brake_map_calibrator/accel_brake_map_calibrator_node.hpp"
#include "autoware_accel_brake_map_calibrator/accel_brake_map_calibrator_node.hpp"

#include "rclcpp/logging.hpp"

Expand All @@ -26,7 +26,7 @@
#include <utility>
#include <vector>

namespace accel_brake_map_calibrator
namespace autoware::accel_brake_map_calibrator
{

AccelBrakeMapCalibrator::AccelBrakeMapCalibrator(const rclcpp::NodeOptions & node_options)
Expand Down Expand Up @@ -305,6 +305,7 @@ void AccelBrakeMapCalibrator::timerCallback()
// lack of data
RCLCPP_WARN_STREAM_THROTTLE(
get_logger(), *get_clock(), 5000, "lack of topics (twist, steer, accel, brake)");

lack_of_data_count_++;
return;
}
Expand Down Expand Up @@ -1691,4 +1692,4 @@ void AccelBrakeMapCalibrator::addLogToCSV(
<< ", " << new_accel_mse << "," << rmse_rate << std::endl;
}

} // namespace accel_brake_map_calibrator
} // namespace autoware::accel_brake_map_calibrator
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
// limitations under the License.
//

#include "accel_brake_map_calibrator/accel_brake_map_calibrator_node.hpp"
#include "autoware_accel_brake_map_calibrator/accel_brake_map_calibrator_node.hpp"

#include <memory>

int main(int argc, char ** argv)
{
rclcpp::init(argc, argv);
rclcpp::NodeOptions node_options;
rclcpp::spin(std::make_shared<accel_brake_map_calibrator::AccelBrakeMapCalibrator>(node_options));
rclcpp::spin(
std::make_shared<autoware::accel_brake_map_calibrator::AccelBrakeMapCalibrator>(node_options));
rclcpp::shutdown();
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def main(args=None):


if __name__ == "__main__":
package_path = get_package_share_directory("accel_brake_map_calibrator")
package_path = get_package_share_directory("autoware_accel_brake_map_calibrator")
parser = argparse.ArgumentParser()
parser.add_argument(
"-d", "--default-map-dir", default=None, type=str, help="directory of default map"
Expand Down
2 changes: 1 addition & 1 deletion vehicle/autoware_raw_vehicle_cmd_converter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Once the acceleration map is crafted, it should be loaded when the RawVehicleCmd

### Auto-Calibration Tool

For ease of calibration and adjustments to the lookup table, an auto-calibration tool is available. More information and instructions for this tool can be found [here](https://github.com/autowarefoundation/autoware.universe/blob/main/vehicle/accel_brake_map_calibrator/accel_brake_map_calibrator/README.md).
For ease of calibration and adjustments to the lookup table, an auto-calibration tool is available. More information and instructions for this tool can be found [here](https://github.com/autowarefoundation/autoware.universe/blob/main/vehicle/autoware_accel_brake_map_calibrator/README.md).

## Input topics

Expand Down

0 comments on commit e57e9f1

Please sign in to comment.