Getting error: Check failed: lua_istable(L, -1) Topmost item on Lua stack is not a table!

When using cartographer_ros with ros2 in my local system I keep getting this error on launching cartographer_node: Check failed: lua_istable(L, -1) Topmost item on Lua stack is not a table!

Complete error log

[INFO] [cartographer_node-2]: process started with pid [397]
[INFO] [occupancy_grid_node-3]: process started with pid [399]
[cartographer_node-2] [INFO] [1620718207.251355230] [cartographer_ros]: I0511 07:30:07.000000   397 configuration_file_resolver.cc:41] Found '/ros2_ws/install/gps_nav/share/gps_nav/params/cartographer_mapping.lua' for 'cartographer_mapping.lua'.
[cartographer_node-2] F0511 07:30:07.252526   397 lua_parameter_dictionary.cc:116] Check failed: lua_istable(L, -1) Topmost item on Lua stack is not a table!
[cartographer_node-2] [FATAL] [1620718207.253007848] [cartographer_ros]: F0511 07:30:07.000000   397 lua_parameter_dictionary.cc:116] Check failed: lua_istable(L, -1) Topmost item on Lua stack is not a table!
[cartographer_node-2] *** Check failure stack trace: ***
[occupancy_grid_node-3] [WARN] [1620718208.258555604] [occ_grid_node]: submap_slices and last_frame_id is empty
[cartographer_node-2]     @     0x7f525ec541c3  google::LogMessage::Fail()
[cartographer_node-2]     @     0x7f525ec5925b  google::LogMessage::SendToLog()
[cartographer_node-2]     @     0x7f525ec53ebf  google::LogMessage::Flush()
[cartographer_node-2]     @     0x7f525ec546ef  google::LogMessageFatal::~LogMessageFatal()
[cartographer_node-2]     @     0x56424dcc7632  (unknown)
[cartographer_node-2]     @     0x56424dcc90db  (unknown)
[cartographer_node-2]     @     0x56424dcc92c1  (unknown)
[cartographer_node-2]     @     0x56424dcad2cd  (unknown)
[cartographer_node-2]     @     0x56424dc261c4  (unknown)
[cartographer_node-2]     @     0x7f525e1b40b3  __libc_start_main
[cartographer_node-2]     @     0x56424dc28a2e  (unknown)
[ERROR] [cartographer_node-2]: process has died [pid 397, exit code -6, cmd '/opt/ros/foxy/lib/cartographer_ros/cartographer_node -configuration_directory /ros2_ws/install/gps_nav/share/gps_nav/params -configuration_basename cartographer_mapping.lua --ros-args -r scan:=/lidar/scan -r odom:=odometry/local -r imu:=/imu/imu_raw'].
[occupancy_grid_node-3] [WARN] [1620718209.258470851] [occ_grid_node]: submap_slices and last_frame_id is empty

However, my .lua file is basically the same as the one in tutorial and works in the tutorial when I change it

Here is my .lua file:

include "map_builder.lua"
include "trajectory_builder.lua"
options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,
  map_frame = "map",
  tracking_frame = "base_link",
  published_frame = "odom",
  odom_frame = "odom",
  provide_odom_frame = false,
  publish_frame_projected_to_2d = true,
  use_odometry = true,
  use_nav_sat = true,
  use_landmarks = false,
  num_laser_scans = 1,
  num_multi_echo_laser_scans = 0,
  num_subdivisions_per_laser_scan = 1,
  num_point_clouds = 0,
  lookup_transform_timeout_sec = 0.2,
  submap_publish_period_sec = 0.3,
  pose_publish_period_sec = 5e-3,
  trajectory_publish_period_sec = 30e-3,
  rangefinder_sampling_ratio = 1.,
  odometry_sampling_ratio = 1.,
  fixed_frame_pose_sampling_ratio = 1.,
  imu_sampling_ratio = 1.,
  landmarks_sampling_ratio = 1.,
}
MAP_BUILDER.use_trajectory_builder_2d = true
TRAJECTORY_BUILDER_2D.min_range = 1
TRAJECTORY_BUILDER_2D.max_range = 3.5
TRAJECTORY_BUILDER_2D.missing_data_ray_length = 3.
TRAJECTORY_BUILDER_2D.use_imu_data = false
TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = false 
TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(0.1)
POSE_GRAPH.constraint_builder.min_score = 0.65
POSE_GRAPH.constraint_builder.global_localization_min_score = 0.7
return options

I feel it’s a dependency issue. Here is my Dockerfile under which I am running this:

FROM osrf/ros:foxy-desktop
LABEL maintainer="Siddharth Saha <sisaha@ucsd.edu>"
RUN apt-get update --fix-missing \
 && apt-get install -y \
    wget \
    lsb-release \
    sudo \
    mesa-utils \
    python3-pip \
    git

RUN python3 -m pip install --upgrade pip

RUN pip3 install --no-cache-dir numpy \
                                pandas \
                                matplotlib \
                                sklearn \
                                pyyaml \
                                rospkg

RUN apt-get install -y \
    ros-foxy-cartographer-ros \
    ros-foxy-robot-localization \
    ros-foxy-navigation2 \
    ros-foxy-nav2-bringup \
    ros-foxy-robot-state-publisher \
    ros-foxy-pointcloud-to-laserscan \
    ros-foxy-image-transport \
    ros-foxy-lgsvl-bridge \
    ros-foxy-lgsvl-msgs \
    ros-foxy-image-transport-plugins \
 && apt-get clean

Any help will be greatly appreciated

Is it possible to compare to the container run in RobotIgnite? I am able to map perfectly fine with any configuration file I make here but if I move it to my system it fails because of this error

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.