上海比较好的网站建设公司宿迁网站设计

diannao/2026/1/23 13:40:52/文章来源:
上海比较好的网站建设公司,宿迁网站设计,在哪个网站上做外贸好,如何做微信下单小程序ROS笔记之rosbag的快速切片(C实现) —— 杭州 2023-12-21 夜 code review 文章目录 ROS笔记之rosbag的快速切片(C实现)1.运行效果2.文件结构3.fast_rosbag_slice.cpp4.CMakeLists.txt5.package.xml6.对fast_rosbag_slice.cpp进行函数封装 正常该功能是ROS官方命令行#xff1a…ROS笔记之rosbag的快速切片(C实现) —— 杭州 2023-12-21 夜 code review 文章目录 ROS笔记之rosbag的快速切片(C实现)1.运行效果2.文件结构3.fast_rosbag_slice.cpp4.CMakeLists.txt5.package.xml6.对fast_rosbag_slice.cpp进行函数封装 正常该功能是ROS官方命令行rosbag filter来实现但速度太慢. 代码抄自大佬的Githubhttps://github.com/berndpfrommer/fast_rosbag_slice.git 1.运行效果 input_bag的情况 运行想得到后50s的bag rosrun fast_rosbag_slice fast_rosbag_slice -i a.bag -o output.bag -s 1686903228.56 -e 1686903278.56耗时8.68s(windows虚拟机环境) output_bag的情况 2.文件结构 3.fast_rosbag_slice.cpp // -*-c-*-------------------------------------------------------------------- // Copyright 2022 Bernd Pfrommer bernd.pfrommergmail.com // // Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License.#include rosbag/bag.h #include rosbag/view.h #include unistd.h#include chrono #include iostream #include limitsvoid usage() {std::cout usage: std::endl;std::cout fast_rosbag_slice -i input_bag -o output_bag -s start_time -e stop_time std::endl; }static size_t process_bag(const std::string inBagName, const std::string outBagName, const double startTime,const double endTime) {std::cout reading from bag: inBagName std::endl;std::cout writing to bag: outBagName std::endl;rosbag::Bag inBag;inBag.open(inBagName, rosbag::bagmode::Read);rosbag::Bag outBag;outBag.open(outBagName, rosbag::bagmode::Write);rosbag::View view(inBag);size_t numMessages(0);for (const rosbag::MessageInstance m : view) {if (m.getTime().toSec() endTime) {break;}if (m.getTime().toSec() startTime) {outBag.write(m.getTopic(), m.getTime(), m);numMessages;}}inBag.close();outBag.close();return (numMessages); }int main(int argc, char ** argv) {int opt;ros::Time::init();std::string inBag;std::string outBag;double startTime(0);double endTime(std::numeric_limitsdouble::max());while ((opt getopt(argc, argv, i:o:s:e:h)) ! -1) {switch (opt) {case i:inBag optarg;break;case o:outBag optarg;break;case s:startTime atof(optarg);break;case e:endTime atof(optarg);break;case h:usage();return (-1);default:std::cout unknown option: opt std::endl;usage();return (-1);break;}}if (inBag.empty() || outBag.empty()) {std::cout missing input or output bag name! std::endl;usage();return (-1);}const auto start std::chrono::high_resolution_clock::now();size_t numMsg process_bag(inBag, outBag, startTime, endTime);const auto end std::chrono::high_resolution_clock::now();auto total_duration std::chrono::duration_caststd::chrono::microseconds(end - start).count();std::cout total time: total_duration * 1e-6 s std::endl;std::cout message processing rate: numMsg * 1e6 / total_duration hz std::endl;return (0); }4.CMakeLists.txt # # Copyright 2022 Bernd Pfrommer bernd.pfrommergmail.com # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an AS IS BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. cmake_minimum_required(VERSION 3.5) project(fast_rosbag_slice)set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Wpedantic -Werror) set (CMAKE_CXX_STANDARD 14)find_package(catkin REQUIRED COMPONENTSroscpprosbag)catkin_package()include_directories(${catkin_INCLUDE_DIRS} )# --------- sync test add_executable(fast_rosbag_slice src/fast_rosbag_slice.cpp) target_link_libraries(fast_rosbag_slice ${catkin_LIBRARIES}) # # volumetric tracking node and nodelet # install(TARGETS fast_rosbag_sliceARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} )5.package.xml ?xml version1.0? package format3namefast_rosbag_slice/nameversion1.0.0/versiondescriptionfast rosbag time slicer/descriptionmaintainer emailbernd.pfrommergmail.comBernd Pfrommer/maintainerlicenseApache2/licensebuildtool_depend condition$ROS_VERSION 1catkin/buildtool_dependdepend condition$ROS_VERSION 1roscpp/dependdepend condition$ROS_VERSION 1rosbag/dependexportbuild_type condition$ROS_VERSION 1catkin/build_type/export/package6.对fast_rosbag_slice.cpp进行函数封装 运行 代码 #include chrono #include iostream #include limits #include rosbag/bag.h #include rosbag/view.hstatic size_t process_bag(const std::string inBagName, const std::string outBagName, const double startTime,const double endTime) {std::cout reading from bag: inBagName std::endl;std::cout writing to bag: outBagName std::endl;rosbag::Bag inBag;inBag.open(inBagName, rosbag::bagmode::Read);rosbag::Bag outBag;outBag.open(outBagName, rosbag::bagmode::Write);rosbag::View view(inBag);size_t numMessages(0);for (const rosbag::MessageInstance m : view) {if (m.getTime().toSec() endTime) {break;}if (m.getTime().toSec() startTime) {outBag.write(m.getTopic(), m.getTime(), m);numMessages;}}inBag.close();outBag.close();return (numMessages); }int main() {std::string inBag /home/user/bag/a.bag;std::string outBag /home/user/bag/output.bag;double startTime 1686903228.56;double endTime 1686903278.56;const auto start std::chrono::high_resolution_clock::now();size_t numMsg process_bag(inBag, outBag, startTime, endTime);const auto end std::chrono::high_resolution_clock::now();auto total_duration std::chrono::duration_caststd::chrono::microseconds(end - start).count();std::cout total time: total_duration * 1e-6 s std::endl;std::cout message processing rate: numMsg * 1e6 / total_duration hz std::endl;return (0); }

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/88928.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

iis7 新建网站网站建设类行业资讯

目录 项目结构 主要步骤 auth-service里: 1. 配置 pom.xml 依赖 2. 实现HandlerInterceptor 接口的 preHandle 函数 3. 实现 WebMvcConfigurer 的 addInterceptors 接口 4. 生成 token 和验证 token 5. 登录接口示例 user-service 里: 6. 实现拦…

谷歌google官方网站北京高端网站建设有限公司

一:题目 二:上码 class Solution { public:/**思路:利用双指针来进行处理*/void reverseString(vector<char>& s) {for (int i 0,j s.size()-1; i < j; i,j--) {swap(s[i],s[j]);}} };

北海 做网站 英文wordpress 用户管理插件

写享元模式的时候&#xff0c;会想使用ConcurrentHashMap来保证并发&#xff0c;没有使用双重锁会不会有问题&#xff1f;但是在synchronize代码块里面需要尽量避免throw异常&#xff0c;希望有经验的同学能够给出解答&#xff1f; 1月6号补充&#xff1a;没有使用双重锁会有问…

用啥网站做首页手机网站图片切换jquery

使用OpenSSL生成自签名SSL/TLS证书和私钥 前提&#xff1a; 系统安装了OpenSSL&#xff1b; 系统&#xff1a;windows、linux都可&#xff1b; 1 生成私钥 创建一个名为 server.key 的私钥文件&#xff0c;并使用 RSA 算法生成一个 2048 位的密钥。 openssl genrsa -out s…

白银市做网站wordpress微信博客模板下载

前言 本专栏旨在通过分类学习算法&#xff0c;使您能够牢固掌握不同算法的理论要点。通过策略性地练习精选的经典题目&#xff0c;帮助您深度理解每种算法&#xff0c;避免出现刷了很多算法题&#xff0c;还是一知半解的状态 专栏导航 二分查找回溯&#xff08;Backtracking&…

手机做任务的网站有哪些内容androidstudio开发app教程

url地址或file文件获取base64 base64转blob blob或file转url&#xff1a; 使用URL.createObjectURL()方法读取出url js读取图片不同信息流

大连企业网站模板做国际网站有什么需要注意的

2019国考成绩要出来了不&#xff1f;2019国考成绩何时出来&#xff1f;现在已是1月中旬&#xff0c;许多考生对于自己的国考笔试成绩都非常期待&#xff0c;而最近风声四起&#xff0c;搞得考生们人心慌慌&#xff0c;那么2019国考成绩要出来了不&#xff1f;现在我们一起来分析…

做网站贵么大连工业大学研究生

Synchronized 底层原理 1. JVM 层面的实现 synchronized 是 Java 中的一个关键字&#xff0c;它提供了一种简单的策略来实现线程同步。在 JVM 层面&#xff0c;synchronized 可以依赖于对象内部的监视器锁&#xff08;monitor lock&#xff09;来实现同步。 锁的获取与释放&a…

ftp怎么设置网站首页国家先进制造业集群

类加载机制 使用某个类时&#xff0c;如果该类的class文件没有加载到内存时&#xff0c;则系统会通过以下三个步骤来对该类进行初始化.   类的加载&#xff08;Load&#xff09; → 2.类的连接&#xff08;Link&#xff09; → 3.类的初始化&#xff08;Initialize&#xf…

北京正规网站建设公司哪家好兰州网站设计

本教程讲解EPS三维测图模块,主要内容有新建工程、创建垂直模型,为后续工作做准备。 目录 一、创建工程 二、生成垂直摄影模型

类似卡盟网站卖怎么做诸城做网站找个人

在Vue中我们有时候会碰到一些需求&#xff0c;就是在点击某个按钮的时候&#xff0c;我们执行别的操作&#xff0c;但是我们希望点击别的操作的时候&#xff0c;让我们之前点击的按钮进行处于高亮状态。 个人在处理业务的时候&#xff0c;测试说&#xff0c;当用户选择某个按钮…

网站搭建图片搜索推广竞价托管哪家好

//2019.7.14晚matplotlib七种常见图像输出编程大全 七种图形汇总输出如下&#xff1a; import numpy as np #导入数据结构nmupy模块import matplotlib.pyplot as plt #导入matplotlib图像输出模块plt.rcParams["font.sans-serif"]["SimHei"] #输出图像的标…

php做视频分享网站安卓市场应用商店下载

挂载&#xff08;mounting&#xff09;是指由操作系统使一个存储设备&#xff08;诸如硬盘、CD-ROM或共享资源&#xff09;上的计算机文件和目录可供用户通过计算机的文件系统访问的一个过程。 本质&#xff1a;针对某一设备, 分析出其文件系统结构, 并根据其文件系统类型调用…

芙蓉区建设局网站外贸邮箱用哪个比较好

在大数据报告中&#xff0c;多头借贷风险、逾期风险、联系人风险、司法风险等是大数据评分评级的重要组成部分&#xff0c;大数据多头借贷风险也是很多银行和金融平台比较看重的&#xff0c;那如果大数据中多头借贷风险严重怎么办呢?本文详细为大家讲讲。 大数据多头风险是什么…

怎么在自己的网站加关键词怎么开平台

深入理解DB2中的日志管理与监控&#xff1a;SYSIBMADM.LOG_UTILIZATION和SYSIBMADM.SNAPDB视图 DB2是一个强大的关系数据库管理系统&#xff0c;日志管理和监控是其运维管理的重要组成部分。本文将深入探讨两个关键的系统管理视图&#xff1a;SYSIBMADM.LOG_UTILIZATION 和 SY…

如何改进网站中英文切换的网站怎么做

不想成为全栈的前端不是好程序员。 数年以前,全栈工程师的理念忽然风靡墙内外,成为开发者们津津乐道的话题。数年过去,关于全栈工程师的争议不多了,教你速成全栈工程师的视频课程多了起来,说明大家对于这个理念慢慢接受了。但我发现,鼓吹前端往全栈转型做的有点走…

龙泉网站开发建网站需成本多少钱

作者&#xff1a; 马国良 | 2006年11月14日13时31分 | 【内容提要】第一名&#xff1a;妈妈说…… 入选原因&#xff1a;单看了两个域名就让人觉得变态“妈妈说就算你注册的域名再长google都能搜索出来”(mamashuojiusuannizhucedeyumingzaichanggoogledounengsousuochulai.cn)…

港口建设网站wordpress php 采集

一&#xff1a;题目&#xff1a; 哥尼斯堡是位于普累格河上的一座城市&#xff0c;它包含两个岛屿及连接它们的七座桥&#xff0c;如下图所示。 可否走过这样的七座桥&#xff0c;而且每桥只走过一次&#xff1f;瑞士数学家欧拉(Leonhard Euler&#xff0c;1707—1783)最终解…

公司网站建设管理网页制作语言

进程&#xff08;Process&#xff09;是具有一定独立功能的程序关于某个数据集合上的一次运行活动&#xff0c;是系统进行资源分配和调度的一个独立单位。程序只是一组指令的有序集合&#xff0c;它本身没有任何运行的含义&#xff0c;只是一个静态实体。而进程则不同&#xff…

开发网站大概要多少钱宁波网站建设推广

一、为什么会有跨域问题&#xff1f; 是因为浏览器的同源策略是对ajax请求进行阻拦了&#xff0c;但是不是所有的请求都给做跨域&#xff0c;像是一般的href属性&#xff0c;a标签什么的都不拦截。 二、解决跨域问题的两种方式 JSONPCORS 三、JSONP 先简单来说一下JSONP&#x…