# Revision history [back]

Hello,

I've set up the navigation stack on my robot. The issue is move_base is publishing the velocity commands on cmd_vel whose message is of type Twist, but my robot is subscribing to a topic called base_velocity whose message is of type TwistStamped. So as I understand, only remapping wouldn't do the work. What can I do to remap topics of different message types.

Thanks.

Hello,

I've set up the navigation stack on my robot. The issue is move_base is publishing the velocity commands on cmd_vel whose message is of type Twist, but my robot is subscribing to a topic called base_velocity whose message is of type TwistStamped. So as I understand, only remapping wouldn't do the work. What can I do to remap topics of different message types.

Thanks.EDIT 1: So I wrote the node below that converts cmd_vel messages to base_velocity, but I get a warning that

Could not process inbound connection: topic types do not match: [geometry_msgs/Twist] vs. [geometry_msgs/TwistStamped]

   #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist, TwistStamped

import time

def callback(cmdVelocity):

baseVelocity = TwistStamped()

baseVelocity.twist = cmdVelocity

now = rospy.get_rostime()

baseVelocityPub = rospy.Publisher('base_velocity', TwistStamped, queue_size=10)
baseVelocityPub.publish(baseVelocity)

def cmd_vel_listener():

rospy.Subscriber("cmd_vel", Twist, callback)

rospy.spin()

if __name__ == '__main__':
rospy.init_node('cmd_vel_listener', anonymous=True)
cmd_vel_listener()


Hello,

I've set up the navigation stack on my robot. The issue is move_base is publishing the velocity commands on cmd_vel whose message is of type Twist, but my robot is subscribing to a topic called base_velocity whose message is of type TwistStamped. So as I understand, only remapping wouldn't do the work. What can I do to remap topics of different message types.

Thanks

EDIT 1:Answer: So I wrote the node below that converts cmd_vel messages to base_velocity, but I get a warning that

Could not process inbound connection: topic types do not match: [geometry_msgs/Twist] vs. [geometry_msgs/TwistStamped]

   #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist, TwistStamped

import time

def callback(cmdVelocity):

baseVelocity = TwistStamped()

baseVelocity.twist = cmdVelocity

now = rospy.get_rostime()

baseVelocityPub = rospy.Publisher('base_velocity', TwistStamped, queue_size=10)
baseVelocityPub.publish(baseVelocity)

def cmd_vel_listener():

rospy.Subscriber("cmd_vel", Twist, callback)

rospy.spin()

if __name__ == '__main__':
rospy.init_node('cmd_vel_listener', anonymous=True)
cmd_vel_listener()