SuperAPI AI 工具集

place-camera-aim-at

通用与其它

查看项目

更新于 10-15 22:38

技能介绍

用途:围绕单个目标 prim 或世界点环形布置 N 台相机,使每台相机对目标都有清晰、无遮挡的视角,基于 isaacsim.sensors.rtx.placement 的 CircularCameraPlacement API。适合多角度产品拍摄或机器人巡检取景。

前提:运行 Isaac Sim 6 / Kit 110 并启用 python_server(端口 8226);启用 isaacsim.sensors.rtx.placement 扩展(action_and_event_data_generation 应用或 --enable);舞台包含目标物体与已烘焙的 navmesh(或传 scope 并设 on_navmesh=false);Shell 环境需 $ISAAC_SIM_DIR、$ISAAC_LAB_DIR、$WORKSPACE_DIR。

主要能力:先隐藏目标 prim,按 height_range、distance_range、look_down_angle_range、yaw_ranges 约束对候选观察方向做射线扫描;恢复可见性后沿各方向按 camera_distance_step_size 步进,保留位于 navmesh(及 scope)内的位置;剔除遮挡比达到 occlusion_threshold 的位姿;用 math_util.select_sparse_vectors 从存活方向中选出彼此最分散的 num_cameras 个,并为每个生成 Camera prim。

使用方式:脚本是 python_server 载荷,非独立程序。可用 run_script("scripts/place_camera_aim_at.py", args=["action=preflight"]),或经 isaac-sim-remote 客户端发送:python skills/isaac-sim-remote/scripts/isaacsim_send.py --file skills/place-camera-aim-at/scripts/place_camera_aim_at.py --arg action=place --arg target_prim=/World/Pallet --arg num_cameras=3。流程为 preflight(默认,只报告不修改舞台)、place(给 target_prim 或 target_point)、verify(相机默认落在 /World/Cameras 下)、iterate(调整 random_seed 或放宽参数)。也可直接调用 API,spawn_camera 默认 False,返回 CameraPose 列表,失败时返回 None,需判空。

限制:不构建 isaacsim.sensors.rtx.placement,需从 source/apps/isaacsim.exp.action_and_event_data_generation.base.kit 消费 pin;仅支持实时 Kit(依赖射线与 navmesh),无离线替代;遮挡基于目标包围盒而非逐三角面;采样是随机的,random_seed、density、geometry 会改变结果;若需地面区域覆盖率而非单目标取景,应使用 place-camera-max-coverage。常见问题包括扩展不可用、存活方向为零导致解包错误、返回位姿为空、相机数不足、目标不可见或高度范围低于目标等,可通过放宽距离/高度/偏航范围、提高 occlusion_threshold(-1 禁用)或设 on_navmesh=false 处理。