I am writing a program using ROS Workspace. There is a structure of data and which is converted to std::vector in somewhere of the codes. I am trying to store the data gained from one of the getters back to the vector.
When I compile the program, there is an error saying "no match for 'operator='" for the line of codes in getBaseRangeToBogie function.
I have pasted the concerning parts of my coding. Could you please tell me how can I solve it?
/home/user/Desktop/pfms-2020a-TheingarAungThan/scratch/a3_skeleton/base.cpp:17: error: no match for ‘operator=’ (operand types are ‘RangeVelocityStamped’ and ‘std::vector<RangeVelocityStamped>’)
baseToBogie = sim->rangeVelocityToBogiesFromBase();
^
doesn't make sense. rangeVelocityToBogiesFromBase() is returning multiple velocities and you're assuming that it returns a single velocity. You need to decide what to do with all of them. Do you want to append the velocities to vec? Which velocity should be assigned to baseToBogie?
Oh, I see now. Thank you for your explanation. So, I changed the codes as the following. Could you please check and let me know that it is correct or not?