ROS WARN Could not process inbound connection: topic types do not match
Hello, I'm working with ROS and AirSim, I'm also using the AirSim ROS Wrapper to comunicate between the two. As you can see, in the link there are some publishers, subscribers and so on... to do the comunication.
I wrote a python script that subscribes to the topic /cmd_vel and then publishes the twist messages on the AirSim topic /airsim_node/vel_cmd_body_frame (a topic from AirSim ROS Wrapper Node). I think the comunication between the two is fine, however when I try to publish on /cmd_vel by doing "rostopic pub /cmd_vel geometry..." I get this warning message on my console:
Could not process inbound connection: topic types do not match: [airsim_ros_pkgs/VelCmd] vs. [geometry_msgs/Twist]{'topic': '/airsim_node/drone_1/vel_cmd_body_frame', 'tcp_nodelay': '0', 'md5sum': 'a787b2802160dcc7fe02d089e10afe56', 'type': 'airsim_ros_pkgs/VelCmd', 'callerid': '/airsim_node'}
I think both of these topics are geometry_msgs/Twist twist, I don't know what I'm doing wrong. Can somebody help me? I will leave my code here, in case there's any mistake:
import rospy
import roslib
import tf
from std_msgs.msg import String
from geometry_msgs.msg import Twist
def callback(msg):
pub = rospy.Publisher('/airsim_node/drone_1/vel_cmd_body_frame', Twist, queue_size=10)
rospy.loginfo("Publishing: [%f, %f, %f]" %(msg.linear.x, msg.linear.y, msg.linear.z))
pub.publish(msg)
def listener():
global msg
rospy.init_node('cmdvel_listener', anonymous=True)
msg = Twist
rospy.Subscriber("/cmd_vel", Twist, callback)
rospy.spin()
if __name__ == '__main__':
listener()