赞
踩
转https://www.ncnynl.com/category/ros-rosbridge_suite/
- { "op": "subscribe",
- "topic": "/cmd_vel",
- "type": "geometry_msgs/Twist"
- }
sudo apt-get install ros-<rosdistro>-rosbridge-server
roslaunch rosbridge_server rosbridge_websocket.launch
- <launch>
- <include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch" >
- <arg name="port" value="8080"/>
- </include>
- </launch>
(1)构建Rosbridge包
sudo apt-get install ros-indigo-rosauth
source /opt/ros/indigo/setup.bash
- $ mkdir -p ~/catkin_ws/src
- $ cd ~/catkin_ws/src
- $ git clone https://github.com/RobotWebTools/rosbridge_suite.git
- $ cd ~/catkin_ws
- $ catkin_make
- $ cd ~/catkin_ws
- $ source devel/setup.bash
- ├── CHANGELOG.rst
- ├── CMakeLists.txt #构建文件,包括Cmake版本,包路径,指明为元包等
- └── package.xml #包信息,包含包名称,版本,介绍,作者,构建依赖,运行依赖等。
- ├── CHANGELOG.rst
- ├── CMakeLists.txt
- ├── msg #定义消息
- │ ├── Num.msg #定义数字消息
- │ ├── TestChar.msg #定义字符消息
- │ ├── TestDurationArray.msg #定义Duration数组消息
- │ ├── TestHeaderArray.msg #定义Header数组消息
- │ ├── TestHeader.msg #定义Header消息
- │ ├── TestHeaderTwo.msg #定义Header消息
- │ ├── TestTimeArray.msg #定义Time数组消息
- │ ├── TestUInt8FixedSizeArray16.msg #定义Unit8[16]消息
- │ └── TestUInt8.msg #定义Unit8[]消息
- ├── package.xml
- ├── setup.py #python安装脚本
- ├── src
- │ └── rosbridge_library #核心库
- │ ├── capabilities #功能包
- │ │ ├── advertise.py #执行话题的广播和取消
- │ │ ├── advertise_service.py #执行服务的广播
- │ │ ├── call_service.py #调用服务
- │ │ ├── defragmentation.py #对消息内容解析
- │ │ ├── fragmentation.py #对消息内容封装
- │ │ ├── __init__.py #声明为Python库
- │ │ ├── publish.py #发布话题
- │ │ ├── service_response.py #服务反馈处理
- │ │ ├── subscribe.py #订阅话题
- │ │ └── unadvertise_service.py #取消服务广播
- │ ├── capability.py
- │ ├── __init__.py
- │ ├── internal #内部功能实现
- │ │ ├── exceptions.py #异常处理
- │ │ ├── __init__.py
- │ │ ├── message_conversion.py #消息转换
- │ │ ├── pngcompression.py #图像压缩
- │ │ ├── publishers.py #跟踪使用特定发布者的客户端。提供用于发布消息和注册使用这个发布者的客户端的API
- │ │ ├── ros_loader.py #ros相关核心类导入
- │ │ ├── services.py #为特定的服务创建服务调用者,使用start()开启独立线程,或在线程中使用run()函数。
- │ │ ├── subscribers.py #管理和与ROS订阅服务器对象接口.单个订阅者在多个客户端之间共享
- │ │ ├── subscription_modifiers.py #位于来自订阅的传入消息和传出消息之间发布方法,提供限制/缓冲功能.当参数改变时,处理程序可以转换到不同的类型的处理程序
- │ │ └── topics.py #发布者和订阅者共同的代码和异常处理
- │ ├── protocol.py #单个客户端与ROS交互的接口.
- │ ├── rosbridge_protocol.py #继承protocol协议,初始化rosbridge功能列表
- │ └── util
- │ └── __init__.py
- ├── srv #服务定义
- │ ├── AddTwoInts.srv #
- │ ├── SendBytes.srv #发送内容定义
- │ ├── TestArrayRequest.srv
- │ ├── TestEmpty.srv
- │ ├── TestMultipleRequestFields.srv
- │ ├── TestMultipleResponseFields.srv
- │ ├── TestNestedService.srv
- │ ├── TestRequestAndResponse.srv
- │ ├── TestRequestOnly.srv
- │ └── TestResponseOnly.srv
- └── test #相关测试,包括核心功能,扩展功能,内部执行
- ├── capabilities
- │ ├── __init__.py
- │ ├── test_advertise.py
- │ ├── test_call_service.py
- │ ├── test_capabilities.test
- │ ├── test_publish.py
- │ └── test_subscribe.py
- ├── experimental
- │ ├── complex_srv+tcp
- │ │ ├── test_non-ros_service_client_complex-srv.py
- │ │ └── test_non-ros_service_server_complex-srv.py
- │ └── fragmentation+srv+tcp
- │ ├── test_non-ros_service_client_fragmented.py
- │ └── test_non-ros_service_server_fragmented.py
- ├── __init__.py
- ├── internal
- │ ├── __init__.py
- │ ├── publishers
- │ │ ├── __init__.py
- │ │ ├── test_multi_publisher.py
- │ │ ├── test_multi_unregistering.py
- │ │ ├── test_publisher_consistency_listener.py
- │ │ └── test_publisher_manager.py
- │ ├── subscribers
- │ │ ├── __init__.py
- │ │ ├── test_multi_subscriber.py
- │ │ ├── test_subscriber_manager.py
- │ │ └── test_subscription_modifiers.py
- │ ├── test_compression.py
- │ ├── test_internal.test
- │ ├── test_message_conversion.py
- │ ├── test_ros_loader.py
- │ └── test_services.py
- └── test_all.test
-

rosbridge_library/src/protocol.py
rosbridge_library/test
- ├── CHANGELOG.rst
- ├── CMakeLists.txt
- ├── launch #启动
- │ ├── rosbridge_tcp.launch #启动TCP服务器,调用rosbridge_tcp.py
- │ ├── rosbridge_udp.launch #启动UDP服务器,调用rosbridge_udp.py
- │ └── rosbridge_websocket.launch #启动WEBSOCKET服务器,调用rosbridge_websocket.py
- ├── package.xml
- ├── scripts
- │ ├── rosbridge_tcp -> ./rosbridge_tcp.py
- │ ├── rosbridge_tcp.py #ros TCP节点, 利用SocketServer实现TCP通讯
- │ ├── rosbridge_udp -> rosbridge_udp.py
- │ ├── rosbridge_udp.py #ros UPD节点,利用reactor.listenUDP实现UDP通讯
- │ ├── rosbridge_websocket -> rosbridge_websocket.py
- │ └── rosbridge_websocket.py #ros websocket节点,利用tornado.web实现websocket通讯
- ├── setup.py
- └── src
- ├── backports
- │ ├── __init__.py
- │ └── ssl_match_hostname
- │ ├── __init__.py
- │ ├── LICENSE.txt
- │ └── README.txt
- ├── rosbridge_server #服务器处理
- │ ├── __init__.py
- │ ├── tcp_handler.py #实现RosbridgeTcpSocket类,用于处理TCP消息
- │ ├── udp_handler.py #实现RosbridgeUdpFactory类和RosbridgeUdpSocket类,用于处理UDP消息
- │ ├── websocket_handler.py #实现RosbridgeWebSocket类,用于处理websocket消息
- └── tornado #Tornado 是 FriendFeed 使用的可扩展的非阻塞式 web 服务器及其相关工具的开源版本
- ├── auth.py
- ├── autoreload.py
- ├── concurrent.py
- ├── curl_httpclient.py
- ├── escape.py
- ├── gen.py
- ├── http1connection.py
- ├── httpclient.py
- ├── httpserver.py
- ├── httputil.py
- ├── __init__.py
- ├── ioloop.py
- ├── iostream.py
- ├── locale.py
- ├── log.py
- ├── log.pyc
- ├── netutil.py
- ├── options.py
- ├── platform
- │ ├── asyncio.py
- │ ├── auto.py
- │ ├── auto.pyc
- │ ├── caresresolver.py
- │ ├── common.py
- │ ├── epoll.py
- │ ├── epoll.pyc
- │ ├── __init__.py
- │ ├── interface.py
- │ ├── kqueue.py
- │ ├── posix.py
- │ ├── select.py
- │ ├── twisted.py
- │ └── windows.py
- ├── process.py
- ├── simple_httpclient.py
- ├── speedups.c
- ├── stack_context.py
- ├── tcpclient.py
- ├── tcpserver.py
- ├── template.py
- ├── test
- │ ├── auth_test.py
- │ ├── concurrent_test.py
- │ ├── csv_translations
- │ │ └── fr_FR.csv
- │ ├── curl_httpclient_test.py
- │ ├── escape_test.py
- │ ├── gen_test.py
- │ ├── gettext_translations
- │ │ └── fr_FR
- │ │ └── LC_MESSAGES
- │ │ ├── tornado_test.mo
- │ │ └── tornado_test.po
- │ ├── httpclient_test.py
- │ ├── httpserver_test.py
- │ ├── httputil_test.py
- │ ├── import_test.py
- │ ├── __init__.py
- │ ├── ioloop_test.py
- │ ├── iostream_test.py
- │ ├── locale_test.py
- │ ├── log_test.py
- │ ├── __main__.py
- │ ├── netutil_test.py
- │ ├── options_test.cfg
- │ ├── options_test.py
- │ ├── process_test.py
- │ ├── README
- │ ├── resolve_test_helper.py
- │ ├── runtests.py
- │ ├── simple_httpclient_test.py
- │ ├── stack_context_test.py
- │ ├── static
- │ │ ├── dir
- │ │ │ └── index.html
- │ │ └── robots.txt
- │ ├── tcpclient_test.py
- │ ├── templates
- │ │ └── utf8.html
- │ ├── template_test.py
- │ ├── test.crt
- │ ├── testing_test.py
- │ ├── test.key
- │ ├── twisted_test.py
- │ ├── util.py
- │ ├── util_test.py
- │ ├── websocket_test.py
- │ ├── web_test.py
- │ └── wsgi_test.py
- ├── testing.py
- ├── util.py
- ├── web.py
- ├── websocket.py
- └── wsgi.py

SocketServer
Twisted/reactor
tornado
- ├── CHANGELOG.rst
- ├── CMakeLists.txt
- ├── msg
- │ └── TypeDef.msg #消息类型定义
- ├── package.xml
- ├── scripts #脚本
- │ └── rosapi_node #初始化服务和参数
- ├── setup.py
- ├── src
- │ └── rosapi #API具体实现
- │ ├── __init__.py
- │ ├── objectutils.py
- │ ├── params.py
- │ └── proxy.py
- └── srv #定义各种服务
- ├── DeleteParam.srv
- ├── GetActionServers.srv
- ├── GetParamNames.srv
- ├── GetParam.srv
- ├── GetTime.srv
- ├── HasParam.srv
- ├── MessageDetails.srv
- ├── NodeDetails.srv
- ├── Nodes.srv
- ├── Publishers.srv
- ├── SearchParam.srv
- ├── ServiceHost.srv
- ├── ServiceNode.srv
- ├── ServiceProviders.srv
- ├── ServiceRequestDetails.srv
- ├── ServiceResponseDetails.srv
- ├── ServicesForType.srv
- ├── Services.srv
- ├── ServiceType.srv
- ├── SetParam.srv
- ├── Subscribers.srv
- ├── TopicsForType.srv
- ├── Topics.srv
- └── TopicType.srv

scripts/rosapi_node
- rospy.Service('/rosapi/topics', Topics, get_topics)
- rospy.Service('/rosapi/topics_for_type', TopicsForType, get_topics_for_type)
- rospy.Service('/rosapi/services', Services, get_services)
- rospy.Service('/rosapi/services_for_type', ServicesForType, get_services_for_type)
- rospy.Service('/rosapi/nodes', Nodes, get_nodes)
- rospy.Service('/rosapi/node_details', NodeDetails, get_node_details)
- rospy.Service('/rosapi/action_servers', GetActionServers, get_action_servers)
- rospy.Service('/rosapi/topic_type', TopicType, get_topic_type)
- rospy.Service('/rosapi/service_type', ServiceType, get_service_type)
- rospy.Service('/rosapi/publishers', Publishers, get_publishers)
- rospy.Service('/rosapi/subscribers', Subscribers, get_subscribers)
- rospy.Service('/rosapi/service_providers', ServiceProviders, get_service_providers)
- rospy.Service('/rosapi/service_node', ServiceNode, get_service_node)
- rospy.Service('/rosapi/service_host', ServiceHost, get_service_host)
- rospy.Service('/rosapi/message_details', MessageDetails, get_message_details)
- rospy.Service('/rosapi/service_request_details', ServiceRequestDetails, get_service_request_details)
- rospy.Service('/rosapi/service_response_details', ServiceResponseDetails, get_service_response_details)
- rospy.Service('/rosapi/set_param', SetParam, set_param)
- rospy.Service('/rosapi/get_param', GetParam, get_param)
- rospy.Service('/rosapi/has_param', HasParam, has_param)
- rospy.Service('/rosapi/search_param', SearchParam, search_param)
- rospy.Service('/rosapi/delete_param', DeleteParam, delete_param)
- rospy.Service('/rosapi/get_param_names', GetParamNames, get_param_names)
- rospy.Service('/rosapi/get_time', GetTime, get_time)

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。