Q1.錯誤訊息「undefined reference to `rosidl_message_type_support_t const* rosidl_typesupport_cpp::get_message_type_support_handle<sensor_msgs::msg::Imu_<std::allocator<void> > >()' collect2: error: ld returned 1 exit status」
sol:請檢查 CMakeLists.txt 的ament_target_dependencies 及 c_cpp_properties.json includePath 及 package.xml 的 depend ,套件/路徑有沒有加入(以上述的訊息,是「sensor_msgs」套件定義漏了)
Q2.錯誤訊息「python3.8/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead 」
sol:除了要「pip install setuptools==58.2.0」把setuptools降級之外,也要把package裡的「setup.cfg」
的「script-dir」及「install-scripts」改為「script_dst」「install_script」
Q3.For python: 執行node時找不到自己定義的模組(明明colcon build都沒錯!!)
sol:請在setup.py的「data_files」裡加上「('lib/' + package_name, [package_name+'/SimpleOneTrailerSystem.py']),」
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
('lib/' + package_name, [package_name+'/DC_Motor.py']),
],
--------
沒有留言:
張貼留言