AttributeError: 'MultiArrayLayout' object has no attribute 'x

114 views Asked by At
#!/usr/bin/env python
import rospy
import json
from custom_msg_json.msg import json_param

#from std_msgs.msg import String



def json_file_reader():

    f = open('/home/arsalan97/ros/sensor_calibration_data.json')
    data = json.load(f)

    for i in data:
        print(i)
    f.close()
    rospy.init_node("json_publisher_node", anonymous=True)
    pub = rospy.Publisher("json_publisher_", json_param, queue_size=10)  
    #rospy.init_node("json_publisher_node", anonymous=True)
    
    rate = rospy.Rate(10)

    msg = 'Publishing now'
    my_param = json_param()
    #my_param.Translation.x= data['Translation'][0]
    my_param.Translation.x = 10
    my_param.Translation.y = 20
    my_param.Translation.z = 30
    my_param.Rotation.x = [1,2,3]
    my_param.Rotation.y = [2,3,4]
    my_param.Rotation.z = [4,5,6]

This is the error I got because I updated .msg file and in that I updated MultiArray with vector3 for Rotation variable but I don't understand why is it still taking Rotation variable as a MultiArray type.

0

There are 0 answers