• 大小: 12.99MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-30
  • 语言: 其他
  • 标签: ROS  通信  

资源简介

在window下,建立与ubuntu系统中ROS的通信,实现将window中的字符发个ubuntu中ROS系统

资源截图

代码片段和文件信息

/*
 * 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;
  }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-01-03 20:29  rosserial_hello_world\
     目录           0  2017-10-16 19:15  rosserial_hello_world\.vs\
     目录           0  2017-10-16 19:15  rosserial_hello_world\.vs\rosserial_hello_world\
     目录           0  2017-10-16 19:15  rosserial_hello_world\.vs\rosserial_hello_world\v14\
     文件       48640  2018-01-03 20:29  rosserial_hello_world\.vs\rosserial_hello_world\v14\.suo
     目录           0  2017-10-17 21:17  rosserial_hello_world\Debug\
     文件      154624  2018-01-03 16:26  rosserial_hello_world\Debug\rosserial_hello_world.exe
     文件     1167284  2018-01-03 16:26  rosserial_hello_world\Debug\rosserial_hello_world.ilk
     文件     1896448  2018-01-03 16:26  rosserial_hello_world\Debug\rosserial_hello_world.pdb
     文件        6388  2017-03-01 17:41  rosserial_hello_world\WindowsSocket.cpp
     文件        2161  2017-03-01 17:41  rosserial_hello_world\WindowsSocket.h
     目录           0  2017-10-16 19:20  rosserial_hello_world\actionlib\
     文件        1540  2017-10-16 09:05  rosserial_hello_world\actionlib\TestAction.h
     文件        1434  2017-10-16 09:05  rosserial_hello_world\actionlib\TestActionFeedback.h
     文件        1380  2017-10-16 09:05  rosserial_hello_world\actionlib\TestActionGoal.h
     文件        1408  2017-10-16 09:05  rosserial_hello_world\actionlib\TestActionResult.h
     文件        1669  2017-10-16 09:05  rosserial_hello_world\actionlib\TestFeedback.h
     文件        1565  2017-10-16 09:05  rosserial_hello_world\actionlib\TestGoal.h
     文件        1617  2017-10-16 09:05  rosserial_hello_world\actionlib\TestRequestAction.h
     文件        1483  2017-10-16 09:05  rosserial_hello_world\actionlib\TestRequestActionFeedback.h
     文件        1429  2017-10-16 09:05  rosserial_hello_world\actionlib\TestRequestActionGoal.h
     文件        1457  2017-10-16 09:05  rosserial_hello_world\actionlib\TestRequestActionResult.h
     文件         679  2017-10-16 09:05  rosserial_hello_world\actionlib\TestRequestFeedback.h
     文件       10030  2017-10-16 09:05  rosserial_hello_world\actionlib\TestRequestGoal.h
     文件        2425  2017-10-16 09:05  rosserial_hello_world\actionlib\TestRequestResult.h
     文件        1617  2017-10-16 09:05  rosserial_hello_world\actionlib\TestResult.h
     文件        1573  2017-10-16 09:05  rosserial_hello_world\actionlib\TwoIntsAction.h
     文件        1455  2017-10-16 09:05  rosserial_hello_world\actionlib\TwoIntsActionFeedback.h
     文件        1401  2017-10-16 09:05  rosserial_hello_world\actionlib\TwoIntsActionGoal.h
     文件        1429  2017-10-16 09:05  rosserial_hello_world\actionlib\TwoIntsActionResult.h
     文件         659  2017-10-16 09:05  rosserial_hello_world\actionlib\TwoIntsFeedback.h
............此处省略1031个文件信息

评论

共有 条评论