float error while using a float - custom messages
Hello all,
I am receiving this error.
[example36-1] self.age.year = 2022
[example36-1] File "/home/user/ros2_ws/install/custom_interfaces/lib/python3.8/site-packages/custom_interfaces/msg/_age.py", line 131, in year
[example36-1] assert \
[example36-1] AssertionError: The 'year' field must be of type 'float'
Only, I am using a float.
from custom_interfaces.msg import Age
...
def on_shutdown(self):
self.age.year = 2022
self.age.month = 5
self.age.day = 1
self.get_logger().info('date this program was made : %s' %
self.age.day + '/%s' % self.age.month + '/%s' % self.age.year)
And if you'd like to see the age message type
float32 year
float32 month
float32 day
Pretty sure I compiled it correctly and stuff since when I run
user:~/ros2_ws$ ros2 interface show custom_interfaces/msg/Age
float32 year
float32 month
float32 day
It spits it out.