Ask Your Question
0

gmapping problem [closed]

asked 2015-07-02 15:22:40 -0500

updated 2015-07-02 15:45:44 -0500

Dear friends,

I have built a simple environment to carry out some tests in order to learn ros (new user).

I have built a urdf and using the appropriate launch I start the gazebo simulation

?xml version="1.0"?>
<launch>
    <!-- this launch file corresponds to robot model in ros-pkg/robot_descriptions/pr2/erratic_defs/robots for full erratic -->
    <param name="/use_sim_time" value="true" />

    <!-- start up wg world -->
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find simple_package)/worlds/MYROBOT.world"/>
    </include>

    <arg name="model" />
    <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)" />
    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" >
    </node>

    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    </node>
    <node name="spawn_robot" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -z 0.1 -model robot_model" respawn="false" output="screen" />
</launch>

In another terminal I send a recurring cmd_vel like:

rostopic pub -r 10 /cmd_vel geometry_msgs/Twist  '{linear:  {x: 0.1, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}'

and I can clearly see that the robot moves in the gazebo simulation.

The problem is when I try to execute the gmapping package. In the terminal when I execute

rosrun gmapping slam_gmapping scan:=/scan odom_frame:=/odom

I get either:

 terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
Aborted (core dumped)

or

Illegal instruction (core dumped)

a screenshot of my graph looks like: image description

Do you have any idea what it goes wrong?

My ros version is indigo

Thanks in advance for your help

UPDATE. I tried to follow the simple tutorial and again I get

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
Aborted (core dumped)

I downloaded the existing bag

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by allenh1
close date 2015-07-02 19:11:31.581906

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-07-02 18:02:58 -0500

Well after what I noticed in the tutorial (as I refer in the update) I performed a sudo apt-get dist-upgrade and now is working fine.

edit flag offensive delete link more

Comments

nice! Thank you

Ziwen Qin gravatar image Ziwen Qin  ( 2016-07-27 01:33:35 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-07-02 15:22:40 -0500

Seen: 1,391 times

Last updated: Jul 02 '15