JointState message
void callback(const sensor_msgs::JointState::ConstPtr& msg)
{
sensor_msgs::JointState output;
output.name=msg->name;
output.position=msg->position;
output.header=msg->header;
pub_.publish(output);
}
the topic i subscribe is “Joint_states”
the msg->name=[‘Joint0’,‘Joint1’,‘Joint2’,‘Joint3’,‘Joint4’,‘Joint5’]
i want to make the array output.name=[Joint0]
i try to write output.name=“Joint0” but when complile there is an error or output.name=msg->name[0] also the same problem
is the size of array "output.name" is fixed cause the error