ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

I think you are just having a namespace issue. By placing the <rosparam> tag inside of the get_intrinsic node tag you are telling all of the parameters to load up inside of the get_intrinsic namespace. For example, running your launch file then the rosparam list command should return

/get_extrinsic/extrinsic_parameters/rotation_matrix/cols
/get_extrinsic/extrinsic_parameters/rotation_matrix/data
/get_extrinsic/extrinsic_parameters/rotation_matrix/rows
/get_extrinsic/extrinsic_parameters/translation_vector/cols
/get_extrinsic/extrinsic_parameters/translation_vector/data
/get_extrinsic/extrinsic_parameters/translation_vector/rows

In your code, you look up the first one using an absolute name that agrees with the above names.... see the following line:

if(!node.getParam("/get_extrinsic/extrinsic_parameters/rotation_matrix/cols", cols))

All of the rest of your params you lookup using relative naming like this:

if(!node.getParam("rotation_matrix/cols", cols))

With your current launch file, that will resolve to /rotation_matrix/cols not /get_extrinsic/extrinsic_parameters/rotation_matrix/cols. Using a private nodehandle would be a good way to fix this. Also check out the Names page and the roscpp/Overview/NodeHandles page.

I think you are just having a namespace issue. By placing the <rosparam> tag inside of the get_intrinsicget_extrinsic node tag you are telling all of the parameters to load up inside of the get_intrinsicget_extrinsic namespace. For example, running your launch file then the rosparam list command should return

/get_extrinsic/extrinsic_parameters/rotation_matrix/cols
/get_extrinsic/extrinsic_parameters/rotation_matrix/data
/get_extrinsic/extrinsic_parameters/rotation_matrix/rows
/get_extrinsic/extrinsic_parameters/translation_vector/cols
/get_extrinsic/extrinsic_parameters/translation_vector/data
/get_extrinsic/extrinsic_parameters/translation_vector/rows

In your code, you look up the first one using an absolute name that agrees with the above names.... see the following line:

if(!node.getParam("/get_extrinsic/extrinsic_parameters/rotation_matrix/cols", cols))

All of the rest of your params you lookup using relative naming like this:

if(!node.getParam("rotation_matrix/cols", cols))

With your current launch file, that will resolve to /rotation_matrix/cols not /get_extrinsic/extrinsic_parameters/rotation_matrix/cols. Using a private nodehandle would be a good way to fix this. Also check out the Names page and the roscpp/Overview/NodeHandles page.