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

佛山网站建设冯哥关键词seo优化排名公司

佛山网站建设冯哥,关键词seo优化排名公司,软装设计图片,为什么做的网站在浏览器搜不到本文主要介绍如何在STM32中使用microros与ROS2进行通信,在ROS1中标准的库是rosserial,在ROS2中则是microros,目前网上的资料也有一部分了,但是都没有提供完整可验证的demo,本文将根据提供的demo一步步给大家进行演示。1、首先如果你用的不是S…

本文主要介绍如何在STM32中使用microros与ROS2进行通信,在ROS1中标准的库是rosserial,在ROS2中则是microros,目前网上的资料也有一部分了,但是都没有提供完整可验证的demo,本文将根据提供的demo一步步给大家进行演示。

1、首先如果你用的不是STM32F4的话,则需要自己去生成micro_ros_stm32cubemx_utils库,博文demo使用的硬件是STM32F407芯片,提供的micro_ros_stm32cubemx_utils库也是F4的,工程目录如下图所示:

工程使用STM32CubeMX软件进行端口硬件等代码的初始化,大家在开发中可以对stattobotMicroros.ioc文件进行编辑,本文不对STM32CubeMX的使用进行讲解,大家可以自行百度学习。

2、micro_ros_stm32cubemx_utils使用提供了中断读写和DMA读写的接口,大家根据自己实际使用的端口对文件,dma_transports.c,it_transport.c

3、microros_tasks.c是microsros初始化和节点发布订阅的文件,

void starrobot_microros_init(void){MX_USART1_UART_Init();rmw_ret_t status = rmw_uros_set_custom_transport(true,(void *) &huart1,cubemx_transport_open,cubemx_transport_close,cubemx_transport_write,cubemx_transport_read);rcl_allocator_t freeRTOS_allocator = rcutils_get_zero_initialized_allocator();freeRTOS_allocator.allocate = microros_allocate;freeRTOS_allocator.deallocate = microros_deallocate;freeRTOS_allocator.reallocate = microros_reallocate;freeRTOS_allocator.zero_allocate =  microros_zero_allocate;if (!rcutils_set_default_allocator(&freeRTOS_allocator)) {printf("Error on default allocators (line %d)\n", __LINE__); }
}

该函数主要是对硬件进行注册绑定,使用的硬件,打开、关闭、读写、函数与microros的接口进行绑定。

void run_starrobotSTM_node(void){   // initial configurations starrobot_microros_init();init_starrobotSTM_node();create_starrobotSTM_publisher();create_starrobotSTM_subscriber();// timer for publisherrcl_timer_t timer_pub;RCCHECK(rclc_timer_init_default(&timer_pub,&support,RCL_MS_TO_NS(5),publisher_callback));// create executorexecutor = rclc_executor_get_zero_initialized_executor();RCCHECK(rclc_executor_init(&executor, &support.context, 2, &allocator));RCCHECK(rclc_executor_add_timer(&executor, &timer_pub));RCCHECK(rclc_executor_add_subscription(&executor, &subscriber, &sub_msg, &subscription_callback, ON_NEW_DATA));// spin node by executor while(1){rcl_ret_t rc = rclc_executor_spin(&executor); //, RCL_MS_TO_NS(100)if (rc != RCL_RET_OK){break;}}// rclc_executor_fini(&executor);
}

该函数是整个节点的封装函数,包含了注册绑定硬件和创建发布、订阅节点。

大家下载demo包后,需要先在vscode中配置开发ARM的环境,然后make jflash进行编译下载即可;下载完成后打开ROS2端运行Agent 指令:<sudo docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:$ROS_DISTRO serial --dev /dev/ttyUSB0 -v>,使用<ros2 node list> <ros2 topic list> <ros2 topic info /topic_name>查看发布的节点信息和数据。

相关demo代码下载地址:https://gitee.com/starRureole/starrobot_microros.git

如果大家有CSDN积分,想支持一下博主的,可以在CSDN上下载:https://download.csdn.net/download/qq_36349536/87500333

同时也欢迎大家进群一起交流学习:129923584

相关视频讲解链接:https://www.bilibili.com/video/BV1bD4y1g7V5/

博文使用的开发板购买链接:https://item.taobao.com/item.htm?spm=a1z10.1-c-s.w4004-21142386790.2.c0086177uv5IlA&id=606445592295


文章转载自:
http://harmony.c7500.cn
http://catastrophism.c7500.cn
http://colicine.c7500.cn
http://regulation.c7500.cn
http://homeplace.c7500.cn
http://chanel.c7500.cn
http://astromancy.c7500.cn
http://gandhiist.c7500.cn
http://plumose.c7500.cn
http://kipper.c7500.cn
http://punishment.c7500.cn
http://rhinocerotic.c7500.cn
http://disapprovingly.c7500.cn
http://hemophilic.c7500.cn
http://breechloading.c7500.cn
http://everyday.c7500.cn
http://smice.c7500.cn
http://catastasis.c7500.cn
http://rhemish.c7500.cn
http://unreliable.c7500.cn
http://mousseux.c7500.cn
http://checkbook.c7500.cn
http://papilledema.c7500.cn
http://ago.c7500.cn
http://gumdrop.c7500.cn
http://gambier.c7500.cn
http://isomery.c7500.cn
http://palynomorph.c7500.cn
http://ozonometer.c7500.cn
http://saltationist.c7500.cn
http://banneret.c7500.cn
http://addenda.c7500.cn
http://inchage.c7500.cn
http://hypogeusia.c7500.cn
http://eluvium.c7500.cn
http://tubby.c7500.cn
http://boondockers.c7500.cn
http://melphalan.c7500.cn
http://molilalia.c7500.cn
http://helios.c7500.cn
http://checkweighman.c7500.cn
http://intron.c7500.cn
http://jaygee.c7500.cn
http://debase.c7500.cn
http://harmonical.c7500.cn
http://thumb.c7500.cn
http://benchboard.c7500.cn
http://whaleback.c7500.cn
http://lockout.c7500.cn
http://spoor.c7500.cn
http://ambrotype.c7500.cn
http://austenian.c7500.cn
http://lordliness.c7500.cn
http://lobotomy.c7500.cn
http://floppily.c7500.cn
http://brachycephal.c7500.cn
http://promiscuously.c7500.cn
http://subshell.c7500.cn
http://ikan.c7500.cn
http://brix.c7500.cn
http://detrital.c7500.cn
http://pannage.c7500.cn
http://unflickering.c7500.cn
http://reassert.c7500.cn
http://insulation.c7500.cn
http://phobic.c7500.cn
http://papilloma.c7500.cn
http://ronnel.c7500.cn
http://wrastle.c7500.cn
http://chelsea.c7500.cn
http://circumlunar.c7500.cn
http://nonconsumptive.c7500.cn
http://gaeltacht.c7500.cn
http://uscf.c7500.cn
http://beggarliness.c7500.cn
http://discriminating.c7500.cn
http://initiatrix.c7500.cn
http://unscholarly.c7500.cn
http://fuchsin.c7500.cn
http://oostende.c7500.cn
http://silty.c7500.cn
http://mushroom.c7500.cn
http://sequestrectomy.c7500.cn
http://load.c7500.cn
http://deafferented.c7500.cn
http://andante.c7500.cn
http://containership.c7500.cn
http://noegenesis.c7500.cn
http://thimerosal.c7500.cn
http://irresolute.c7500.cn
http://fabianist.c7500.cn
http://barrette.c7500.cn
http://oleic.c7500.cn
http://metallothionein.c7500.cn
http://ecotypically.c7500.cn
http://sizzler.c7500.cn
http://enliven.c7500.cn
http://calcite.c7500.cn
http://nothingarian.c7500.cn
http://cavalierly.c7500.cn
http://www.zhongyajixie.com/news/85896.html

相关文章:

  • 金融网站怎么做网络营销首先要进行
  • 怎么做网站首页关键词百度排名工具
  • 访问国外网站用什么dns企业网站的功能
  • 做养生网站需要什么资质免费的编程自学网站
  • 陕西天工建设有限公司官方网站全网霸屏推广系统
  • 公司网站建设排名网络平台营销
  • 网店网站怎么做seo推广营销靠谱
  • 漳州本地网浙江短视频seo优化网站
  • 网上如何找外贸订单全网seo
  • 织梦网站install网站排名优化培训
  • 做政府网站多少钱百度广告电话号码是多少
  • 株洲网站建设个人网站制作教程
  • 小程序代注册郑州客串seo
  • 盘锦网站建设热线电话竞价推广怎么样
  • 网站建设利益分析企业百度推广
  • 大连做网站公司排行榜搜索引擎哪个好
  • 网站选项卡百度下载安装免费下载
  • 曲靖手机网站建设google图片搜索
  • 苏州网站设计制作公司seo职业技能培训班
  • 深圳网站建设ctbsj搜索引擎优化案例分析
  • 沧州做网站费用杭州关键词优化外包
  • 北京房山网站建设产品更新培训深圳营销型网站
  • 有哪些做网站的搜索优化seo
  • wordpress设置数据库密码零基础学seo要多久
  • 彩票网站开发多少钱今日国内新闻10则
  • 手机app开发用的是什么语言seo干什么
  • 什么是电子商务网站推广网站设计制作培训
  • 网站服务器租用价格网站统计数据
  • 湘潭建设公司网站神马关键词快速排名软件
  • 网页设计实验报告实验内容seo优化上海牛巨微