当前位置: 首页 > news >正文

合肥做网站一般多少钱网站关键词快照优化

合肥做网站一般多少钱,网站关键词快照优化,域名网址注册,谷德设计网介绍如是我闻#xff1a; 资产类#xff08;asset classes#xff09;允许我们创建和模拟机器人#xff0c;而传感器 (sensors) 则帮助我们获取关于环境的信息#xff0c;获取不同的本体感知和外界感知信息。例如#xff0c;摄像头传感器可用于获取环境的视觉信息#xff0c…如是我闻 资产类asset classes允许我们创建和模拟机器人而传感器 (sensors) 则帮助我们获取关于环境的信息获取不同的本体感知和外界感知信息。例如摄像头传感器可用于获取环境的视觉信息接触传感器可以用来获取机器人与环境的接触信息。 在本指南中我们将看到如何给机器人添加不同的传感器。我们将在本指南中使用ANYmal-C机器人。ANYmal-C是一款四足机器人拥有12个自由度它有4条腿每条腿有3个自由度。这款机器人配备了以下传感器 机器人头部的摄像头传感器提供RGB-D图像提供地形高度信息的高度扫描传感器机器人脚部的接触传感器提供接触信息 本指南对应于orbit/source/standalone/tutorials/04_sensors目录下的add_sensors_on_robot.py脚本。让我们先搂一眼完整的代码 # Copyright (c) 2022-2024, The ORBIT Project Developers. # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause This script demonstrates how to add and simulate on-board sensors for a robot.We add the following sensors on the quadruped robot, ANYmal-C (ANYbotics):* USD-Camera: This is a camera sensor that is attached to the robots base. * Height Scanner: This is a height scanner sensor that is attached to the robots base. * Contact Sensor: This is a contact sensor that is attached to the robots feet... code-block:: bash# Usage./orbit.sh -p source/standalone/tutorials/04_sensors/add_sensors_on_robot.pyfrom __future__ import annotationsLaunch Isaac Sim Simulator first.import argparsefrom omni.isaac.orbit.app import AppLauncher# add argparse arguments parser argparse.ArgumentParser(descriptionTutorial on adding sensors on a robot.) parser.add_argument(--num_envs, typeint, default2, helpNumber of environments to spawn.) # append AppLauncher cli args AppLauncher.add_app_launcher_args(parser) # parse the arguments args_cli parser.parse_args()# launch omniverse app app_launcher AppLauncher(args_cli) simulation_app app_launcher.appRest everything follows.import torch import tracebackimport carbimport omni.isaac.orbit.sim as sim_utils from omni.isaac.orbit.assets import ArticulationCfg, AssetBaseCfg from omni.isaac.orbit.scene import InteractiveScene, InteractiveSceneCfg from omni.isaac.orbit.sensors import CameraCfg, ContactSensorCfg, RayCasterCfg, patterns from omni.isaac.orbit.utils import configclass## # Pre-defined configs ## from omni.isaac.orbit_assets.anymal import ANYMAL_C_CFG # isort: skipconfigclass class SensorsSceneCfg(InteractiveSceneCfg):Design the scene with sensors on the robot.# ground planeground AssetBaseCfg(prim_path/World/defaultGroundPlane, spawnsim_utils.GroundPlaneCfg())# lightsdome_light AssetBaseCfg(prim_path/World/Light, spawnsim_utils.DomeLightCfg(intensity3000.0, color(0.75, 0.75, 0.75)))# robotrobot: ArticulationCfg ANYMAL_C_CFG.replace(prim_path{ENV_REGEX_NS}/Robot)# sensorscamera CameraCfg(prim_path{ENV_REGEX_NS}/Robot/base/front_cam,update_period0.1,height480,width640,data_types[rgb, distance_to_image_plane],spawnsim_utils.PinholeCameraCfg(focal_length24.0, focus_distance400.0, horizontal_aperture20.955, clipping_range(0.1, 1.0e5)),offsetCameraCfg.OffsetCfg(pos(0.510, 0.0, 0.015), rot(0.5, -0.5, 0.5, -0.5), conventionros),)height_scanner RayCasterCfg(prim_path{ENV_REGEX_NS}/Robot/base,update_period0.02,offsetRayCasterCfg.OffsetCfg(pos(0.0, 0.0, 20.0)),attach_yaw_onlyTrue,pattern_cfgpatterns.GridPatternCfg(resolution0.1, size[1.6, 1.0]),debug_visTrue,mesh_prim_paths[/World/defaultGroundPlane],)contact_forces ContactSensorCfg(prim_path{ENV_REGEX_NS}/Robot/.*_FOOT, update_period0.0, history_length6, debug_visTrue)def run_simulator(sim: sim_utils.SimulationContext,scene: InteractiveScene, ):Run the simulator.# Define simulation steppingsim_dt sim.get_physics_dt()sim_time 0.0count 0# Simulate physicswhile simulation_app.is_running():# Resetif count % 500 0:# reset countercount 0# reset the scene entities# root state# we offset the root state by the origin since the states are written in simulation world frame# if this is not done, then the robots will be spawned at the (0, 0, 0) of the simulation worldroot_state scene[robot].data.default_root_state.clone()root_state[:, :3] scene.env_originsscene[robot].write_root_state_to_sim(root_state)# set joint positions with some noisejoint_pos, joint_vel (scene[robot].data.default_joint_pos.clone(),scene[robot].data.default_joint_vel.clone(),)joint_pos torch.rand_like(joint_pos) * 0.1scene[robot].write_joint_state_to_sim(joint_pos, joint_vel)# clear internal buffersscene.reset()print([INFO]: Resetting robot state...)# Apply default actions to the robot# -- generate actions/commandstargets scene[robot].data.default_joint_pos# -- apply action to the robotscene[robot].set_joint_position_target(targets)# -- write data to simscene.write_data_to_sim()# perform stepsim.step()# update sim-timesim_time sim_dtcount 1# update buffersscene.update(sim_dt)# print information from the sensorsprint(-------------------------------)print(scene[camera])print(Received shape of rgb image: , scene[camera].data.output[rgb].shape)print(Received shape of depth image: , scene[camera].data.output[distance_to_image_plane].shape)print(-------------------------------)print(scene[height_scanner])print(Received max height value: , torch.max(scene[height_scanner].data.ray_hits_w[..., -1]).item())print(-------------------------------)print(scene[contact_forces])print(Received max contact force of: , torch.max(scene[contact_forces].data.net_forces_w).item())def main():Main function.# Initialize the simulation contextsim_cfg sim_utils.SimulationCfg(dt0.005, substeps1)sim sim_utils.SimulationContext(sim_cfg)# Set main camerasim.set_camera_view(eye[3.5, 3.5, 3.5], target[0.0, 0.0, 0.0])# design scenescene_cfg SensorsSceneCfg(num_envsargs_cli.num_envs, env_spacing2.0)scene InteractiveScene(scene_cfg)# Play the simulatorsim.reset()# Now we are ready!print([INFO]: Setup complete...)# Run the simulatorrun_simulator(sim, scene)if __name__ __main__:try:# run the main executionmain()except Exception as err:carb.log_error(err)carb.log_error(traceback.format_exc())raisefinally:# close sim appsimulation_app.close()代码解析 与之前我们在场景中添加资产的教程类似传感器也是通过场景配置添加到场景中的。所有的传感器都继承自sensors.SensorBase类并通过各自的配置类进行配置。每个传感器实例都可以定义自己的更新周期即传感器更新的频率。更新周期通过sensors.SensorBaseCfg.update_period属性以秒为单位指定。 根据指定的路径和传感器类型传感器会被附加到场景中的原始图元prims上。传感器可能直接和在场景中已创建的原始图元关联或者可能被附加到一个已存在的原始图元上。例如摄像头传感器会附加在一个已经创建好的原始图元上而对于接触传感器激活中的接触报告是刚体原始图元上的一个属性。 接下来我们将介绍如何使用不同的传感器以及如何配置。要了解更多关于它们的描述请查看sensors模块。 摄像头传感器 Camera sensor 摄像头是使用sensors.CameraCfg类来定义的。它基于USD摄像头传感器不同的数据类型由Omniverse Replicator API来捕获。由于摄像头在场景中有对应的原始图元prim所以在指定的原始图元路径上会创建原始图元。 摄像头传感器的配置包括以下参数 spawn创建的USD摄像头类型。可以是PinholeCameraCfg针孔摄像头配置或FisheyeCameraCfg鱼眼摄像头配置。 offset摄像头传感器相对于父原始图元的偏移。 data_types要捕获的数据类型。可以是rgb、distance_to_image_plane到图像平面的距离、normals法线或其他USD摄像头传感器支持的类型。 为了将RGB-D摄像头传感器附加到机器人的头部我们指定了一个相对于机器人基座的偏移offset。偏移是相对于基座指定的平移和旋转以及偏移的指定方式。 接下来我们来看如何使用摄像头传感器配置。我们将更新周期设置为0.1秒这意味着摄像头传感器以10Hz的频率更新。原始图元路径表达式设置为{ENV_REGEX_NS}/Robot/base/front_cam其中{ENV_REGEX_NS}是环境命名空间Robot是机器人的名称base是摄像头附加的原始图元的名称而front_cam是与摄像头传感器关联的原始图元的名称。 高度扫描仪scanner 高度扫描仪作为一种虚拟传感器通过使用NVIDIA Warp的光线投射内核来实现。通过sensors.RayCasterCfg我们可以指定要投射的光线模式以及要对哪些网格进行光线投射。由于它们是虚拟传感器在场景中没有相应的原始物体(prims)被创建。相反它们附加到场景中的一个原始物体上这用于指定传感器的位置。 在本指南中基于光线投射的高度扫描仪附加到机器人的基座上。光线的模式使用pattern属性指定。对于均匀网格模式我们使用GridPatternCfg指定模式。由于我们只关心高度信息我们不需要考虑机器人的滚转和俯仰。因此我们将attach_yaw_only设置为true。 对于高度扫描仪我们可以可视化光线击中网格的点。这是通过将debug_vis属性设置为true来完成的。 高度扫描仪的整个配置如下 height_scanner RayCasterCfg(prim_path{ENV_REGEX_NS}/Robot/base,update_period0.02,offsetRayCasterCfg.OffsetCfg(pos(0.0, 0.0, 20.0)),attach_yaw_onlyTrue,pattern_cfgpatterns.GridPatternCfg(resolution0.1, size[1.6, 1.0]),debug_visTrue,mesh_prim_paths[/World/defaultGroundPlane],)接触传感器 Contact sensor 接触传感器利用PhysX的接触报告API来获取机器人与环境的接触信息。由于它依赖于PhysX接触传感器期望在机器人的刚体上启用接触报告API。这可以通过在资产配置中设置activate_contact_sensors为true来完成。 通过sensors.ContactSensorCfg可以指定我们想要获取接触信息的原始物体(prims)。可以设置额外的标志以获取更多关于接触的信息例如接触空中时间、过滤原始物体之间的接触力等。 在本指南中我们将接触传感器附加到机器人的脚上。机器人的脚被命名为LF_FOOT、“RF_FOOT”、“LH_FOOT和RF_FOOT”。我们传递一个正则表达式.*_FOOT来简化原始物体路径的指定。这个正则表达式匹配所有以_FOOT结尾的原始物体。 我们将更新周期设置为0以使传感器与模拟以相同的频率更新。此外对于接触传感器我们可以指定要存储的接触信息的历史长度。对于这个教程我们将历史长度设置为6这意味着存储了最后6个模拟步骤的接触信息。 接触传感器的整个配置如下 contact_forces ContactSensorCfg(prim_path{ENV_REGEX_NS}/Robot/.*_FOOT, update_period0.0, history_length6, debug_visTrue)运行模拟循环 与使用资产时相似传感器的缓冲区和物理句柄只有在播放模拟时才会初始化即在创建场景后调用sim.reset()是很重要的。 # Play the simulatorsim.reset()除此之外模拟循环与之前的指南类似。传感器作为场景更新的一部分进行更新它们内部处理基于它们更新周期的缓冲区更新。 可以通过它们的data属性访问传感器的数据。作为示例我们展示如何访问本教程中创建的不同传感器的数据 # print information from the sensorsprint(-------------------------------)print(scene[camera])print(Received shape of rgb image: , scene[camera].data.output[rgb].shape)print(Received shape of depth image: , scene[camera].data.output[distance_to_image_plane].shape)print(-------------------------------)print(scene[height_scanner])print(Received max height value: , torch.max(scene[height_scanner].data.ray_hits_w[..., -1]).item())print(-------------------------------)print(scene[contact_forces])print(Received max contact force of: , torch.max(scene[contact_forces].data.net_forces_w).item())代码运行 现在让我们运行脚本并查看结果 ./orbit.sh -p source/standalone/tutorials/04_sensors/add_sensors_on_robot.py --num_envs 2这个命令应该会打开一个带有地面平面、灯光和两个四足机器人的舞台。在机器人周围应该会看到红色的球体这些球体表示光线击中网格的点。另外你可以切换视口到摄像机视图以查看摄像头传感器捕获的RGB图像。请查看这里以了解如何切换视口到摄像机视图的更多信息。 要停止模拟可以关闭窗口或在终端中按CtrlC。 虽然在这个教程中我们讲解了创建和使用不同的传感器但在sensors模块中还有许多其他传感器可用。我们在source/standalone/tutorials/04_sensors目录中包含了使用这些传感器的示例。这些脚本可以使用以下命令运行 # Frame Transformer ./orbit.sh -p source/standalone/tutorials/04_sensors/run_frame_transformer.py# Ray Caster ./orbit.sh -p source/standalone/tutorials/04_sensors/run_ray_caster.py# Ray Caster Camera ./orbit.sh -p source/standalone/tutorials/04_sensors/run_ray_caster_camera.py# USD Camera ./orbit.sh -p source/standalone/tutorials/04_sensors/run_usd_camera.py愿本文除一切机器人模拟器苦 以上
http://www.w-s-a.com/news/830550/

相关文章:

  • 新手做网站视频网页设计期末作品要求
  • 做网站用户充值提现郑州高端模板建站
  • 运城做网站方式方法网站改版完成
  • 上海建设网站制作东西湖建设局网站
  • 建设购物网站课程设计建设部领导干部官方网站
  • 沈阳企业制作网站北京两学一做网站
  • 郑州做营销型网站手机网站建设多少钱一个
  • 小说类网站程序外贸商城 wordpress
  • 喀什百度做网站多少钱wordpress 用户介绍
  • 专门做任务的网站手机端网站重构
  • 深圳专业设计网站公司国际网站建设经验
  • 网站产品页排名怎么做网站备案起名要求
  • 成都企业网站建设及公司ppt生活分类信息网站大全
  • 免费企业网站源码下载学服装设计需要什么条件
  • 淘宝网站开发方式深圳平面设计公司排名榜
  • 品牌网站建设收费情况登陆页面模板
  • 十大免费cms建站系统介绍科技网站欣赏
  • 自学做网站需要多久semir是什么品牌
  • 南通网站搜索引擎优化网站首页seo关键词布局
  • 东莞市国外网站建设多少钱wordpress 多媒体插件
  • c2c商城网站建设公司做水果生意去哪个网站
  • 做网站服务器有哪些电子商务网站建立
  • 网站开发的具体流程原材料价格查询网站
  • 深圳响应式网站建设深圳网站建设定制开发 超凡科技
  • 网站建设报价怎么差别那么大wordpress产品属性搭配
  • 高校网站建设情况报告范文pc建站网站
  • 做网站美工要学什么广东省建设厅网站首页
  • 深圳网站设计十年乐云seo网站建设 竞赛 方案
  • 新乡移动网站建设wordpress输出某一分类的文章
  • 花店网站开发设计的项目结构重庆网站建设培训班