资源简介
移植rosserial到stm32所需要的库,按https://github.com/yoneken/rosserial_stm32.git中操作生成
代码片段和文件信息
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2011 Willow Garage Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage Inc. nor the names of its
* contributors may be used to endorse or promote prducts derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* “AS IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT
* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT
* INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING
* BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT
* LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include
#include “ros/duration.h“
namespace ros
{
void normalizeSecNSecSigned(int32_t &sec int32_t &nsec)
{
int32_t nsec_part = nsec;
int32_t sec_part = sec;
while (nsec_part > 1000000000L)
{
nsec_part -= 1000000000L;
++sec_part;
}
while (nsec_part < 0)
{
nsec_part += 1000000000L;
--sec_part;
}
sec = sec_part;
nsec = nsec_part;
}
Duration& Duration::operator+=(const Duration &rhs)
{
sec += rhs.sec;
nsec += rhs.nsec;
normalizeSecNSecSigned(sec nsec);
return *this;
}
Duration& Duration::operator-=(const Duration &rhs)
{
sec += -rhs.sec;
nsec += -rhs.nsec;
normalizeSecNSecSigned(sec nsec);
return *this;
}
Duration& Duration::operator*=(double scale)
{
sec *= scale;
nsec *= scale;
normalizeSecNSecSigned(sec nsec);
return *this;
}
}
相关资源
- STM32F103RC+ADC+DMA多通道采样LCD显示
- I2C读写AT24C02 基于STM32F103 cube116540
- Microsoft Forms 2.0107770
- 基于stm32f103ve的程序——跑马灯实验
- 基于STM32RCT6的步进电机驱动程序
- Rational Rose Common破解文件
- stm32f407上的两个can发送和接收例程
- STM32 led 时钟
- STM32 2.4G通信例程
- 直流无刷电机方波驱动 stm32 例程代码
- STM32中文资料
- STM32蓝牙和串口程序
- STM32f103超声波模块例程
- stm32f103c8t6 4 oled.rar
- stm32f030 IAP Demo(原创)
- STM32基于rt_thread操作系统的SDHC卡文件
- NRF24L01实现51与STM32双向通讯
- STM32F103 串口程序(完整版)
- stm32 ds18b20 温度传感器 测试通过
- stm32官方例程
- STM32F103定时器中断程序
- [免费]基于stm32f103ze 的OLED驱动代码
- STM32F103RBT6驱动UC1698控制芯片的160160黑
- STM32F103 DS18B20 V3.5.0固件库驱动程序工
- STM32定时器使用入门。看了这个程序会
- SIM908 SDIO FSMC STM32 FIFO
- STM32F103 CC2500完整驱动(模拟SPI)
- AD7606采集程序
- Microsoft基本类库 (MFC)(C 库)
- stm32 用SPI 方式读写 SDHC
评论
共有 条评论