import rospy
from nav_msgs.msg import Odometry

publisher = None

def send_computed_control_actions(msg):
    publisher.publish(msg)
    

if __name__ == '__main__':
    rospy.init_node('pose')
    subscriber = rospy.Subscriber('computed_pose', Odometry, send_computed_control_actions)
    publisher = rospy.Publisher('cmd_vel', Odometry, queue_size=1)
    rospy.spin()

import rospy
from geometry_msgs.msg import Twist

publisher = None

def send_computed_control_actions(msg):
    publisher.publish(msg)
    

if __name__ == '__main__':
    rospy.init_node('twist')
    subscriber = rospy.Subscriber('computed_control_actions', Twist, send_computed_control_actions)
    publisher = rospy.Publisher('cmd_vel', Twist, queue_size=1)
    rospy.spin()

Change publisher and subscriber message type from Odometry to Twist
Change publisher and subscriber message type from Odometry to Twist


  import rospy
- from nav_msgs.msg import Odometry
+ from geometry_msgs.msg import Twist
  
  publisher = None
  
  def send_computed_control_actions(msg):
      publisher.publish(msg)
      
  
  if __name__ == '__main__':
-     rospy.init_node('pose')
+     rospy.init_node('twist')
-     subscriber = rospy.Subscriber('computed_pose', Odometry, send_computed_control_actions)
+     subscriber = rospy.Subscriber('computed_control_actions', Twist, send_computed_control_actions)
-     publisher = rospy.Publisher('cmd_vel', Odometry, queue_size=1)
+     publisher = rospy.Publisher('cmd_vel', Twist, queue_size=1)
      rospy.spin()
  
Change publisher and subscriber message type from Odometry to Twist
## Code Before:
import rospy
from nav_msgs.msg import Odometry

publisher = None

def send_computed_control_actions(msg):
    publisher.publish(msg)
    

if __name__ == '__main__':
    rospy.init_node('pose')
    subscriber = rospy.Subscriber('computed_pose', Odometry, send_computed_control_actions)
    publisher = rospy.Publisher('cmd_vel', Odometry, queue_size=1)
    rospy.spin()

## Instruction:
Change publisher and subscriber message type from Odometry to Twist
## Code After:
import rospy
from geometry_msgs.msg import Twist

publisher = None

def send_computed_control_actions(msg):
    publisher.publish(msg)
    

if __name__ == '__main__':
    rospy.init_node('twist')
    subscriber = rospy.Subscriber('computed_control_actions', Twist, send_computed_control_actions)
    publisher = rospy.Publisher('cmd_vel', Twist, queue_size=1)
    rospy.spin()
