ros

“cv2.imdecode(numpyArray, cv2.CV_LOAD_IMAGE_COLOR)” returns None

那年仲夏 提交于 2019-12-06 15:28:50
I'm trying to convert an image into Opencv (into numpy array) and use the array to publish the message over a ROS node. I tried doing the same through the following code fig.canvas.draw() nparr = np.fromstring ( fig.canvas.tostring_argb(), np.uint8 ) print nparr img_np = cv2.imdecode(nparr, cv2.CV_LOAD_IMAGE_COLOR) print img_np image_message = bridge.cv2_to_imgmsg(img_np, encoding="passthrough") pub.publish(image_message) But, when I tried doing this I get an error message AttributeError: 'NoneType' object has no attribute 'shape' So, I tried printing the values of both the numpy array whose

Cmake not detecting boost-python when installing ROS

二次信任 提交于 2019-12-06 13:42:09
I have been trying to install ROS on my Mac and have gotten around the errors with different libraries depending on different versions of boost. However, it seems that one library is not even detecting boost-python. Here is the error I get: CMake Error at /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:2048 (message): Unable to find the requested Boost libraries. Boost version: 1.67.0 Boost include path: /usr/local/include Could not find the following static Boost libraries: boost_python Some (but not all) of the required Boost libraries were found. You may need to install these additional

ROS通信原理介绍

我只是一个虾纸丫 提交于 2019-12-06 08:10:51
本文将主要对clearpathrobotics网站关于ROS的介绍进行翻译。原文网址 https://www.clearpathrobotics.com/2014/01/how-to-guide-ros-101/ 。 1,何为ROS? ROS(Robot Operating System)是遵从BSD许可的系统,它可以在PC上控制机器人的各个组件。ROS系统由多个各自独立的节点(组件)组成,并且各个节点之间可以通过发布/订阅(publish/subscribe)消息模型进行通信。例如,我们将一个特定传感器的驱动模块作为一个ROS节点,其将传感器数据发布(publish)到消息流。这些消息可能会被某些节点获取到,例如滤波器、记录器、更高级系统中的应用如导航、路径查找等节点。 (从此段可以理解,ROS的publish操作为某个节点将其自身数据或传感器数据发送到一个注册到ROS中的消息池中,其他节点可以申请获取数据,而publish数据的节点不关心哪些节点需要,其他节点如何获取数据将在下面介绍。) 2,为何使用ROS? ROS中的节点可以运行在不同的系统、平台,甚至是不同的架构中。假如有一个Arduino publish的消息,你可以使用笔记本订阅(subscribe)此消息,也可以使用android手机驾驶摩托。对于用户的需求,ROS具有灵活适应性,并且它还是开源的

dbus通信与接口介绍

大城市里の小女人 提交于 2019-12-06 07:45:29
DBUS是一种高级的进程间通信机制。DBUS支持进程间一对一和多对多的对等通信,在多对多的通讯时,需要后台进程的角色去分转消息,当一个进程发消息给另外一个进程时,先发消息到后台进程,再通过后台进程将信息转发到目的进程。DBUS后台进程充当着一个路由器的角色。 DBUS中主要概念为总线,连接到总线的进程可通过总线接收或传递消息,总线收到消息时,根据不同的消息类型进行不同的处理。DBUS中消息分为四类: 1. Methodcall消息:将触发一个函数调用 ; 2. Methodreturn消息:触发函数调用返回的结果; 3. Error消息:触发的函数调用返回一个异常 ; 4. Signal消息:通知,可以看作为事件消息。 1.2 DBUS应用场景 根据DBUS消息类型可知,DBUS提供一种高效的进程间通信机制,主要用于进程间函数调用以及进程间信号广播。 1 . 函数调用 DBUS可以实现进程间函数调用,进程A发送函数调用的请求(Methodcall消息),经过总线转发至进程B。进程B将应答函数返回值(Method return消息)或者错误消息(Error消息)。 2 . 消息广播 进程间消息广播(Signal消息)不需要响应,接收方需要向总线注册感兴趣的消息类型,当总线接收到“Signal消息”类型的消息时,会将消息转发至希望接收的进程。 1.3 DBUS通信特点

Solving a difficult compilation issue

依然范特西╮ 提交于 2019-12-06 06:32:48
Good day, First up, I have a mac running Mavericks, and I am attempting to build PCL (Point Cloud Library) as part of ROS. This is the command that fails: cd /Users/X/ros_catkin_ws/build_isolated/pcl_ros && /Users/X/ros_catkin_ws/install_isolated/env.sh cmake -vd /Users/X/ros_catkin_ws/src/perception_pcl/pcl_ros -DCATKIN_DEVEL_PREFIX=/Users/X/ros_catkin_ws/devel_isolated/pcl_ros -DCMAKE_INSTALL_PREFIX=/Users/X/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=Release With: CMake Error at /usr/local/share/pcl-1.8/PCLConfig.cmake:47 (message): simulation is required but glew was not found Call

How would you publish a message in ROS of a vector of structs?

大兔子大兔子 提交于 2019-12-06 01:50:31
问题 I want to publish a vector of unknown length of structs that contain two integers and two strings. Is there a publisher and subscriber in ROS that can do this? If not, I've been looking at the tutorial of how to create custom messages and I figure I can make one .msg file containing: int32 upperLeft int32 lowerRight string color string cameraID and another .msg file containing an array of the previous messages. But the tutorial does not give an example of how to use arrays, so I do not know

ros+pcl error recoder

断了今生、忘了曾经 提交于 2019-12-05 23:01:27
Could not find a package configuration file provided by "pcl_conversions" with any of the following names: pcl_conversionsConfig.cmake pcl_conversions-config.cmake after running catkin_make $sudo apt-get update $sudo apt-get install ros-indigo-pcl-conversions $sudo apt-get install ros-indigo-pcl-ros 来源: https://www.cnblogs.com/gris/p/11949486.html

ROS package not found after catkin_make

只愿长相守 提交于 2019-12-05 19:20:16
问题 I created a ROS workspace following the Wiki page from ROS. I also created a package using catkin_create_pkg under the workspace I just created. Then, following the steps in ROS Wiki to build the package using catkin_make , after the package is built, I insert the command rospack find packagename , and my package is not found anymore. Can anyone help me on this? 回答1: Have you followed this basic tutorial? You have to create the package in your workspace and have set properly your Bash file

【转载】编写简单的消息发布器和订阅器

大兔子大兔子 提交于 2019-12-05 17:44:31
目录 1.功能包的创建 2.功能包的源代码编写 3.功能包的编译配置及编译 4.功能包的启动运行 通过上一节编写 ROS 的第一个程序 hello_world ,我们对 ROS 的整个编程开发过程有了基本的了解,现在我们就来编写真正意义上的使用 ROS 进行节点间通信的程序。由于之前已经建好了 catkin_ws 这样一个工作空间,以后开发的功能包都将放在这里面,这里给新建的功能包取名为 topic_example ,在这个功能包中分别编写两个节点程序 publish_node.cpp 和 subscribe_node.cpp ,发布节点( publish_node )向话题( chatter )发布 std_msgs::String 类型的消息,订阅节点( subscribe_node )从话题( chatter )订阅 std_msgs::String 类型的消息,这里消息传递的具体内容是一句问候语“ how are you ... ”,通信网络结构如图 16 。 ( 图 16 ) 消息发布与订阅 ROS 通信网络结构图 1.功能包的创建 在 catkin_ws/src/ 目录下新建功能包 topic_example ,并在创建时显式的指明依赖 roscpp 和 std_msgs 。打开命令行终端,输入命令: cd ~/catkin_ws/src/ #创建功能包topic

【转载】如何编写ROS的第一个程序hello_world

有些话、适合烂在心里 提交于 2019-12-05 17:41:21
如何编写ROS的第一个程序hello_world 既然ROS已经成功安装好了,大家一定很想亲自动动手编一个通过起手式例程hello_world,可以学到工作空间的创建、功能包的创建、功能包的源代码编写、功能包的编译配置、功能包的编译、功能包的启动运行等知识。ROS的小程序试试手,没错,这一节就隆重请出程序界的起手式例程hello_world。 通过起手式例程hello_world,可以学到工作空间的创建、功能包的创建、功能包的源代码编写、功能包的编译配置、功能包的编译、功能包的启动运行等知识。 (1)工作空间的创建 打开命令行终端,分别输入如下命令: #先切回主目录 cd ~/ #新建工作空间文件夹 mkdir catkin_ws #在catkin_ws目录下新建src文件夹 cd catkin_ws mkdir src #初始化src目录,生成的CMakeLists.txt为功能包编译配置 cd src catkin_init_workspace #切回catkin_ws目录,对该工作空间执行一次编译 cd ~/catkin_ws catkin_make #环境变量配置,使新建的catkin_ws工作空间可用 source devel/setup.bash 这时,便已经创建好了一个ROS的工作空间了,接下来就是在catkin