in ROS

Rosserial Windows与ROS之间的通信

小结

测试了下Rosserial Windows与ROS之间的通信,解决了几个问题。

过程

参考链接及代码,以Turtlesim为实验进行了配置,记录一些指令如下:

john@ubuntu:~$ sudo apt-get install ros-noetic-rosserial-windows

john@ubuntu:~$ sudo apt-get install ros-noetic-rosserial-server

john@ubuntu:~$ roscore

john@ubuntu:~$ rosrun turtlesim turtlesim_node 


john@ubuntu:~$  rosrun rosserial_server socket_node
[ INFO] [1658159352.315079648]: Listening for rosserial TCP connections on port 11411
john@ubuntu:~$ rostopic list
/rosout
/rosout_agg
/turtle1/cmd_vel
/turtle1/color_sensor
/turtle1/pose
john@ubuntu:~$ rostopic echo /turtle1/cmd_vel

问题及解决

问题解决后,测试成功。

问题一:#include “stdafx.h”报错

解决: 设置工程属性,设置Precompiled Header为Not Using Precompiled Headers, 并注释掉//#include "stdafx.h"

问题二: char *赋值的问题

报错: E0144 a value of type "const char *" cannot be used to initialize an entity of type "char *"
解决: 进行工程设置:project property page," C/C++->Language->Conformance mode" , set this value as "No", the error will not show.

问题三: 报错C4146

报错: MSVS 2015 express error C4146 - unary minus operator applied to unsigned type
解决:SDL checks" is set to to "Yes (/sdl)" by default settings,设置工程相应属性为"No (/sdl-)"

参考

实现Linux(ROS)与Windows(Visual studio)信息传输通讯
ROS_Kinetic_26 使用rosserial_windows实现windows与ROS master发送与接收消息
基于rosserial_windows实现ROS与windows通信(亲测可行)
rosserial简介
rosserial_client Package Summary
Const char* isnt working ‘char* sandwich = “ham”‘;
MSVS 2015 express error C4146 – unary minus operator applied to unsigned type
MSVC compiler options error C4146 /sdl (Enable Additional Security Checks)

Write a Comment

Comment