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

Need help locating 'ekf_localization node' inside 'robot_localization' package

asked 2020-11-11 14:01:43 -0500

updated 2020-11-11 14:58:40 -0500

I naviagted to the husky_control package using roscd husky_control. There exists a launch file inside the husky_control package named control.launch.

This is how the control.launch file looks.

<?xml version="1.0"?>
<launch>

  <arg name="multimaster" default="$(optenv ROBOT_MULTIMASTER false)"/>
  <arg name="simulation" default="$(optenv ROBOT_SIMULATION false)"/>
  <arg name="robot_namespace" default="$(optenv ROBOT_NAMESPACE robot)"/>
  <arg name="enable_ekf" default="$(optenv ENABLE_EKF true)"/>

  <arg name="config_extras"
       default="$(eval optenv('HUSKY_CONFIG_EXTRAS', find('husky_control') + '/config/empty.yaml'))"/>

  <arg name="laser_enabled" default="$(optenv HUSKY_LMS1XX_ENABLED false)"/>
  <arg name="realsense_enabled" default="$(optenv HUSKY_REALSENSE_ENABLED false)"/>
  <arg name="urdf_extras" default="$(optenv HUSKY_URDF_EXTRAS)"/>

  <include file="$(find multimaster_launch)/launch/multimaster_robot.launch" if="$(arg multimaster)">
    <arg name="gazebo_interface" value="$(find husky_control)/config/gazebo_interface.yaml" />
    <arg name="public_interface" value="$(find husky_control)/config/public_interface.yaml" />
    <arg name="robot_namespace" value="$(arg robot_namespace)"/>
    <arg name="simulation" value="$(arg simulation)"/>
  </include>

  <!-- Load robot description -->
  <include file="$(find husky_description)/launch/description.launch" >
    <arg name="laser_enabled" default="$(arg laser_enabled)"/>
    <arg name="realsense_enabled" default="$(arg realsense_enabled)"/>
    <arg name="urdf_extras" default="$(arg urdf_extras)"/>
  </include>

  <!-- Load controller configuration -->
  <rosparam command="load" file="$(find husky_control)/config/control.yaml" />

  <!-- Spawn controllers -->
  <node name="base_controller_spawner" pkg="controller_manager" type="spawner"
        args="husky_joint_publisher husky_velocity_controller"/>

  <!-- Start EKF for localization -->
  <group if="$(arg enable_ekf)" >
    <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
      <rosparam command="load" file="$(find husky_control)/config/localization.yaml" />
    </node>
  </group>

  <node pkg="interactive_marker_twist_server" type="marker_server" name="twist_marker_server" output="screen"/>

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />

  <node pkg="twist_mux" type="twist_mux" name="twist_mux">
    <rosparam command="load" file="$(find husky_control)/config/twist_mux.yaml" />
    <remap from="cmd_vel_out" to="husky_velocity_controller/cmd_vel"/>
  </node>

  <!-- Override the default control parameters, see config/empty.yaml for default. -->
  <rosparam command="load" file="$(arg config_extras)" />

</launch>

As we can see, there's an ekf_localization_node inside the robot_localization package. But, when I run the command roscd robot_localization, and navigate to the robot_localization package in my system, I only see the following files/folders:

  - cmake (folder)
  - launch (folder)
  - LICENSE
  - nodelet_plugins.xml
  - package.xml
  - params (folder)
  - srv (folder)

Why don't I see the ekf_localization_node inside the robot_localization package? What am I missing?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-11-11 14:21:24 -0500

That's because roscd takes you to the share folder of a package, but the binaries live somewhere else.

> ls /opt/ros/melodic/lib/robot_localization
ekf_localization_node  robot_localization_listener_node
navsat_transform_node  ukf_localization_node

Replace melodic with the name of your distro if you are on a different one.

Of course, you don't actually need to know where they are if you just want to run them. rosrun robot_localization ekf_localization_node will know where to find the binary and run it.

edit flag offensive delete link more

Comments

Thanks @chfritz. I found it.

I have a few queries though:

  • What is the significance of the share folder?
  • It seems that I can not read the contents of the binary file. Why is that?
  • Is there a way to access the code written inside ekf_localization node?
skpro19 gravatar image skpro19  ( 2020-11-11 15:04:00 -0500 )edit
1

Yes, of course, it's an open source package: https://github.com/cra-ros-pkg/robot_...

chfritz gravatar image chfritz  ( 2020-11-11 15:24:50 -0500 )edit
1

And well, binaries are binary, so humans are not very good at reading them. You indeed are right to assume that you should be reading the source code instead.

chfritz gravatar image chfritz  ( 2020-11-11 15:25:34 -0500 )edit

Got it. Thanks!

skpro19 gravatar image skpro19  ( 2020-11-11 15:29:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-11-11 14:01:43 -0500

Seen: 455 times

Last updated: Nov 11 '20