Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions LibCarla/cmake/fast_dds/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
cmake_minimum_required(VERSION 3.5.1)# ָ��CMake����Ͱ汾Ҫ��
project(libcarla_fastdds)# ������Ŀ���ƺͰ汾
cmake_minimum_required(VERSION 3.5.1)# 指定CMake的最低版本要求
project(libcarla_fastdds)# 设置项目名称和版本


# ��װͷ�ļ�
# ʹ��file(GLOB)�����ռ�������ص�ͷ�ļ����������ǰ�װ��include/carla/ros2Ŀ¼��
# 安装头文件
# 使用file(GLOB)命令收集所有相关的头文件,并将它们安装到include/carla/ros2目录下
file(GLOB libcarla_carla_fastdds_headers
"${libcarla_source_path}/carla/ros2/publishers/*.h"
"${libcarla_source_path}/carla/ros2/subscribers/*.h"
"${libcarla_source_path}/carla/ros2/listeners/*.h"
"${libcarla_source_path}/carla/ros2/types/*.h"
)
install(FILES ${libcarla_carla_fastdds_headers} DESTINATION include/carla/ros2)
# ��װFast DDS�Ķ�̬���ӿ��ļ�
# 安装Fast DDS的动态链接库文件
file(GLOB fast_dds_dependencies "${FASTDDS_LIB_PATH}/*.so*")
install(FILES ${fast_dds_dependencies} DESTINATION lib)

# �ռ�libcarla_fastdds��Դ�ļ�
# 收集libcarla_fastdds的源文件
file(GLOB libcarla_fastdds_sources
"${libcarla_source_path}/carla/ros2/publishers/*.cpp"
"${libcarla_source_path}/carla/ros2/subscribers/*.cpp"
"${libcarla_source_path}/carla/ros2/listeners/*.cpp"
"${libcarla_source_path}/carla/ros2/types/*.cpp")
# ����C++��׼��ͷ�ļ�·���ͱ���ѡ��
# 设置C++标准库头文件路径和编译选项
set(FASTDDS_CPP_STD_INCLUDES "/usr/include/c++/7")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -I${FASTDDS_CPP_STD_INCLUDES}" CACHE STRING "" FORCE)
# �����Ƿ����÷�������Թ�����������Ӧ��Ŀ��
# 根据是否启用发布或调试构建,创建相应的目标
# ==============================================================================
# Create targets for debug and release in the same build type.
# ==============================================================================
# ��������˷����汾����
# 如果启用了发布版本构建
if (LIBCARLA_BUILD_RELEASE)
# ����һ����̬��Ŀ��
# 添加一个静态库目标
add_library(carla_fastdds STATIC ${libcarla_fastdds_sources})
# ���ð���Ŀ¼
# 设置包含目录
target_include_directories(carla_fastdds SYSTEM PRIVATE
"${BOOST_INCLUDE_PATH}"
"${RPCLIB_INCLUDE_PATH}")
# ����Fast DDS������˽�а���Ŀ¼
# 添加Fast DDS和其他私有包含目录
target_include_directories(carla_fastdds PRIVATE "${FASTDDS_INCLUDE_PATH}")
target_include_directories(carla_fastdds PRIVATE "${libcarla_source_path}/carla/ros2")
# ����������
target_include_directories(carla_fastdds PRIVATE "${libcarla_source_path}/carla/ros2")# 将指定路径 "${libcarla_source_path}/carla/ros2" 添加为名为 carla_fastdds 这个目标的私有包含目录。
# 这样在编译与 carla_fastdds 相关代码时,编译器就能在该目录下查找头文件等,PRIVATE 表示此包含目录仅对 carla_fastdds 自身的编译起作用。
# 链接依赖库
target_link_libraries(carla_fastdds fastrtps fastcdr "${FAST_DDS_LIBRARIES}")
# ��װ�⵽libĿ¼
# 安装库到lib目录
install(TARGETS carla_fastdds DESTINATION lib)
set_target_properties(carla_fastdds PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}")

endif()
# ��������˵��԰汾����
# 如果启用了调试版本构建
if (LIBCARLA_BUILD_DEBUG)
# ����һ����̬��Ŀ�꣨���԰棩
add_library(carla_fastdds_debug STATIC ${libcarla_fastdds_sources})# ���ð���Ŀ¼
# 添加一个静态库目标(调试版)
add_library(carla_fastdds_debug STATIC ${libcarla_fastdds_sources})# 设置包含目录
target_include_directories(carla_fastdds_debug SYSTEM PRIVATE
"${BOOST_INCLUDE_PATH}"
"${RPCLIB_INCLUDE_PATH}")
# ��װ���԰�⵽libĿ¼
# 安装调试版库到lib目录
install(TARGETS carla_fastdds_debug DESTINATION lib)
set_target_properties(carla_fastdds_debug PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")# ���ñ����־
target_compile_definitions(carla_fastdds_debug PUBLIC -DBOOST_ASIO_ENABLE_BUFFER_DEBUGGING)# ����Boost��ASIO����
set_target_properties(carla_fastdds_debug PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")# 设置编译标志
target_compile_definitions(carla_fastdds_debug PUBLIC -DBOOST_ASIO_ENABLE_BUFFER_DEBUGGING)# 启用Boost的ASIO调试

endif()
4 changes: 3 additions & 1 deletion PythonAPI/carla/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def walk(folder, file_filter='*'):
# extra_link_args += ['/usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.a']
extra_link_args += ['-lstdc++']
else:
raise NotImplementedError(linux_distro + " not in supported posix platforms: " + str(supported_dists))
raise NotImplementedError(linux_distro + " not in supported posix platforms: " + str(supported_dists))# 抛出一个NotImplementedError异常,异常信息由当前的Linux发行版名称(linux_distro变量的值)
# 与提示信息拼接而成,提示信息表明当前这个Linux发行版不在支持的POSIX平台列表(supported_dists变量转成字符串后的内容)之中,
# 通常用于表示当前代码所在环境对应的Linux发行版不被程序所支持,需要进行相应适配等情况。
elif os.name == "nt":
pwd = os.path.dirname(os.path.realpath(__file__))
pylib = 'libboost_python%d%d' % (
Expand Down
2 changes: 1 addition & 1 deletion PythonAPI/util/check_lidar_bb.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def lidar_is_outside_bb(self, check_axis = [True, True, True]):

return False

def check_lidar_data(self):
def check_lidar_data(self):// 定义类方法check_lidar_data,可能用于检查激光雷达数据,具体功能看内部实现。
if self.lidar_is_outside_bb():
print("Error!!! Points of lidar point cloud are outside its BB for car %d: %s " % (self._actor_id, self._actor_type))
self.print()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ class CARLA_API UCarlaEpisode : public UObject
// Material Parameters 中的更新时间
if (MaterialParameters)
{
MaterialParameters->SetScalarParameterValue(FName("VisualTime"), VisualGameTime);
MaterialParameters->SetScalarParameterValue(FName("VisualTime"), VisualGameTime);// 通过MaterialParameters指针调用SetScalarParameterValue函数
// 第一个参数使用FName构造函数创建了一个名为"VisualTime"的参数名
// 第二个参数VisualGameTime应该是要设置给"VisualTime"这个参数的具体数值(具体类型需看VisualGameTime的定义)
// 整体作用大概率是在程序中(可能是游戏开发等场景涉及材质相关操作)为名为"VisualTime"的材质参数设置对应的值,以影响材质的某种表现特性。
MaterialParameters->SetScalarParameterValue(FName("VisualTime"), VisualGameTi
}
}

Expand Down
5 changes: 4 additions & 1 deletion Unreal/CarlaUE4/Plugins/CarlaTools/CarlaTools.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"CreatedByURL": "http://carla.org",
"DocsURL": "http://carla.readthedocs.io",
"MarketplaceURL": "",
"SupportURL": "https://github.com/carla-simulator/carla/issues",
"SupportURL": "https://github.com/carla-simulator/carla/issues",// "SupportURL"是一个键(key),通常用于表示支持相关的链接地址。
// 对应的值"https://github.com/carla-simulator/carla/issues"是一个具体的URL链接,
// 意味着当遇到与相关项目(此处可能是carla-simulator项目)有关的问题、需要支持或者反馈情况时,
// 可以通过访问这个GitHub仓库对应的问题页面(issues页面)来进行相应操作,比如提交问题、查看已有问题的解决办法等。
"CanContainContent": true,
"IsBetaVersion": false,
"IsExperimentalVersion": true,
Expand Down
9 changes: 8 additions & 1 deletion Util/DockerUtils/fbx/src/FBX2OBJ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ bool SaveScene(
const char* pFilename,
int pFileFormat,
bool pEmbedMedia
)
)// 函数SaveScene用于将一个Fbx场景保存到文件中。
// 参数:
// pSdkManager:指向FbxManager对象的指针,FbxManager是管理整个FBX SDK的核心对象,通常用于处理与FBX文件相关的各种操作,如创建场景、加载/保存文件等。
// pScene:指向要保存的FbxScene对象的指针,该对象包含了场景中的所有数据,如节点、几何体、动画等。
// pFilename:以字符数组形式表示的文件名,指定了要保存场景的目标文件路径和名称。
// pFileFormat:整数类型的参数,用于指定保存文件时所使用的文件格式。不同的整数值可能对应不同的FBX文件格式版本或其他支持的格式。
// pEmbedMedia:布尔类型的参数,用于指示是否将媒体数据(如纹理等)嵌入到保存的文件中。如果为true,则媒体数据会被嵌入到文件内;如果为false,则可能会单独存储媒体数据,文件中仅保留引用信息。
// 返回值:函数返回一个布尔值,表示场景保存操作是否成功。如果成功保存场景,则返回true;否则返回false。
{
bool lStatus = true;
// 创建一个导出器
Expand Down