Reinforcement Learning/examples/envs/mobile_robot_env_gym_multirobots.py
def timer_callback(self):
                       
        " Publish Speed Commands to Robot 1 "
    
        msgl1 = Float32()    
        msgr1 = Float32()
        msgl1.data = self.VL1
        msgr1.data = self.VR1
        self.publisher_l1.publish(msgl1)
        self.publisher_r1.publish(msgr1)

        " Publish Speed Commands to Robot 2 "
        
        msgl2 = Float32()
        msgr2 = Float32()
        msgl2.data = self.VL2
        msgr2.data = self.VR2
        self.publisher_l2.publish(msgl2)
        self.publisher_r2.publish(msgr2)

        " Publish Speed Commands to Robot 3 "
        
        msgl3 = Float32()
        msgr3 = Float32()
        msgl3.data = self.VL3
        msgr3.data = self.VR3
        self.publisher_l3.publish(msgl3)
        self.publisher_r3.publish(msgr3)
        
        " Publish Speed Commands to Robot 4 "
    
        msgl4 = Float32()
        msgr4 = Float32()
        msgl4.data = self.VL4
        msgr4.data = self.VR4
        self.publisher_l4.publish(msgl4)
        self.publisher_r4.publish(msgr4)        
        
        " Publish Speed Commands to Robot 5 "
        
        msgl5 = Float32()
        msgr5 = Float32()
        msgl5.data = self.VL5
        msgr5.data = self.VR5
        self.publisher_l5.publish(msgl5)
        self.publisher_r5.publish(msgr5)        


        " Publish Speed Commands to Robot 6 "
        
        msgl6 = Float32()
        msgr6 = Float32()
        msgl6.data = self.VL6
        msgr6.data = self.VR6
        self.publisher_l6.publish(msgl6)
        self.publisher_r6.publish(msgr6)
 Publish Speed Commands to Robot 1 
Publish Speed Commands to Robot 1
Publish Speed Commands to Robot 1
def timer_callback(self):
        msgl1 = Float32()    
        msgr1 = Float32()
        msgl1.data = self.VL1
        msgr1.data = self.VR1
        self.publisher_l1.publish(msgl1)
        self.publisher_r1.publish(msgr1)
        msgl2 = Float32()
        msgr2 = Float32()
        msgl2.data = self.VL2
        msgr2.data = self.VR2
        self.publisher_l2.publish(msgl2)
        self.publisher_r2.publish(msgr2)
        msgl3 = Float32()
        msgr3 = Float32()
        msgl3.data = self.VL3
        msgr3.data = self.VR3
        self.publisher_l3.publish(msgl3)
        self.publisher_r3.publish(msgr3)
        msgl4 = Float32()
        msgr4 = Float32()
        msgl4.data = self.VL4
        msgr4.data = self.VR4
        self.publisher_l4.publish(msgl4)
        self.publisher_r4.publish(msgr4)        
        msgl5 = Float32()
        msgr5 = Float32()
        msgl5.data = self.VL5
        msgr5.data = self.VR5
        self.publisher_l5.publish(msgl5)
        self.publisher_r5.publish(msgr5)        
        msgl6 = Float32()
        msgr6 = Float32()
        msgl6.data = self.VL6
        msgr6.data = self.VR6
        self.publisher_l6.publish(msgl6)
        self.publisher_r6.publish(msgr6)
def timer_callback ( self ) : msgl1 = Float32 ( ) msgr1 = Float32 ( ) msgl1 . data = self . VL1 msgr1 . data = self . VR1 self . publisher_l1 . publish ( msgl1 ) self . publisher_r1 . publish ( msgr1 ) " Publish Speed Commands to Robot 2 " msgl2 = Float32 ( ) msgr2 = Float32 ( ) msgl2 . data = self . VL2 msgr2 . data = self . VR2 self . publisher_l2 . publish ( msgl2 ) self . publisher_r2 . publish ( msgr2 ) " Publish Speed Commands to Robot 3 " msgl3 = Float32 ( ) msgr3 = Float32 ( ) msgl3 . data = self . VL3 msgr3 . data = self . VR3 self . publisher_l3 . publish ( msgl3 ) self . publisher_r3 . publish ( msgr3 ) " Publish Speed Commands to Robot 4 " msgl4 = Float32 ( ) msgr4 = Float32 ( ) msgl4 . data = self . VL4 msgr4 . data = self . VR4 self . publisher_l4 . publish ( msgl4 ) self . publisher_r4 . publish ( msgr4 ) " Publish Speed Commands to Robot 5 " msgl5 = Float32 ( ) msgr5 = Float32 ( ) msgl5 . data = self . VL5 msgr5 . data = self . VR5 self . publisher_l5 . publish ( msgl5 ) self . publisher_r5 . publish ( msgr5 ) " Publish Speed Commands to Robot 6 " msgl6 = Float32 ( ) msgr6 = Float32 ( ) msgl6 . data = self . VL6 msgr6 . data = self . VR6 self . publisher_l6 . publish ( msgl6 ) self . publisher_r6 . publish ( msgr6 )
Publish Speed Commands to Robot 1
Publish Speed Commands to Robot 1
" Publish Speed Commands to Robot 1 " " Publish Speed Commands to Robot 2 " " Publish Speed Commands to Robot 3 " " Publish Speed Commands to Robot 4 " " Publish Speed Commands to Robot 5 " " Publish Speed Commands to Robot 6 "
self