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

Naman's profile - activity

2023-02-13 23:12:39 -0500 received badge  Good Question (source)
2022-11-18 08:53:41 -0500 received badge  Famous Question (source)
2022-11-14 07:11:50 -0500 marked best answer getting inf values in scan using pointcloud_to_laserscan indigo

Hi,

-- See Update 2 --

I am using iai_kinect2(ROS Indigo and Ubuntu 14.04) to get a depth cloud from my Kinect2 in the form sensor_msgs/Image. Then, it is converted to sensor_msgs/PointCloud2 using depth_image_proc to do all the filtering operations using pcl. Now, I want to use pointcloud_to_laserscan but I am having some issues in converting the filtered_pointcloud to laser_scan. It does not give any error but the output laser_scan contains only INF. There are many related posts like this and this. I can't use depthimage_to_laserscan because I need to merge multiple point clouds and do filtering. Also, I tried changing the target_frame to kinect2_link but that didn't help. Also, I tried changing some of the parameters but no change in the output laser_scan. Here is my launch file :

    <launch>

    <node pkg="kinect2_bridge" type="kinect2_bridge" name="kinect2" output="screen">
        <param name="publish_tf" value="true"/>
    </node> 

    <node pkg="nodelet" type="nodelet" name="standalone_nodelet"  args="manager"/>

    <node pkg="nodelet" type="nodelet" name="point_cloud_xyz" args="load depth_image_proc/point_cloud_xyz standalone_nodelet">
        <remap from="camera_info" to="/kinect2/sd/camera_info"/>
        <remap from="image_rect" to="/kinect2/sd/image_depth_rect"/>    
        <remap from="points" to="/kinect2/pointcloud"/>
    </node>

    <node pkg="kinect2_filtering" type="kinect2_filtering" name="kinect2_filtering" output="screen"/>

    <node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pcl_to_laser" output="screen">
        <remap from="cloud_in" to="/kinect2/pointcloud_filtered"/>
        <remap from="scan" to="scan2"/>
         <rosparam>
                target_frame: kinect2_link # Leave disabled to output scan in pointcloud frame
                transform_tolerance: 0.01
                min_height: 0.0
                max_height: 1.0

                angle_min: -1.5708 # -M_PI/2
                angle_max: 1.5708 # M_PI/2
                angle_increment: 0.0523 # M_PI/360.0
                scan_time: 0.3333
                range_min: 0.45
                range_max: 4.0
                use_inf: true

                # Concurrency level, affects number of pointclouds queued for processing and number of threads used
                # 0 : Detect number of cores
                # 1 : Single threaded
                # 2->inf : Parallelism level
                concurrency_level: 1
            </rosparam>
    </node>

</launch>

I am unable to make pointcloud_to_laserscan work properly. Does anyone have any idea what is the issue here? Any help will be appreciated.

Update 1 : When I changed max_height: 5.0, I get a laser_scan but it is completely wrong. Here it is :

header: 
  seq: 7653
  stamp: 
    secs: 1452114415
    nsecs: 194144000
  frame_id: kinect2_link
angle_min: -1.57079994678
angle_max: 1.57079994678
angle_increment: 0.0522999987006
time_increment: 0.0
scan_time: 0.333299994469
range_min: 0.449999988079
range_max: 4.0
ranges: [inf, inf, inf, inf, inf, inf, inf, inf, inf, 0.45063257217407227, 0.45248475670814514, 0.4535152316093445, 0.454106867313385, 0.45574814081192017, 0.45014896988868713, 0.45500892400741577, 0.4504481256008148, 0.45145583152770996, 0.450962096452713, 0.45117509365081787, 0.45415404438972473, 0.4528849124908447, 0.4500834047794342, 0.45053648948669434, 0.4508683979511261, 0.4519908130168915, 0.45469483733177185, 0.4522281289100647, 0.45500484108924866, 0.45522522926330566, 0.45422250032424927, 0.4566135108470917, 0.4510946571826935, 0.45335447788238525, 0.45148807764053345, 0.4525870084762573, 0.45198413729667664, 0.45033854246139526, 0.4502975344657898, 0.45032933354377747, 0.4510512351989746, 0.4511733055114746, 0.45179998874664307, 0.4508054852485657, 0.45005494356155396, 0.45013701915740967, 0.4505907893180847, 0.45257997512817383, 0.4503863453865051, 0.45146650075912476, 0.45116832852363586, 0.45020565390586853, 0.4511633813381195, 0.4503015875816345, 0.4507128894329071, 0.4509909152984619, 0.4540099501609802, 0.4507279098033905, 0.45697665214538574, 0.45599526166915894, 0.45608508586883545]
intensities: []

Ranges are either INF or very close to range_min (0.45). Here is ... (more)

2022-08-19 14:58:30 -0500 received badge  Nice Question (source)
2022-08-19 01:17:04 -0500 marked best answer setting covariances for robot_localization

Hi all,

I have a mobile robot and I am using robot_localization to fuse data from wheel_encoders, IMU and hokuyo lidar (using AMCL). In the first instance of robot_localization, I have wheel_encoders and IMU in the odom_frame and in the second instance of robot_localization, I have wheel_encoders and output of AMCL (amcl_pose (geometry_msgs/PoseWithCovarianceStamped)) in the map_frame.

This is my launch file for the second instance of robot_localization :

<launch>

<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization2" clear_params="true">

  <param name="frequency" value="10"/>

  <param name="sensor_timeout" value="0.5"/>

  <param name="two_d_mode" value="true"/>

  <param name="map_frame" value="map"/>
  <param name="odom_frame" value="odom_combined"/>
  <param name="base_link_frame" value="base_footprint"/>
  <param name="world_frame" value="map"/>

  <param name="transform_time_offset" value="0.0"/>

  <param name="odom0" value="odom"/>
  <param name="pose0" value="amcl_pose"/>

  <rosparam param="odom0_config">[false, false, false,
                                  false, false, false,
                                  true, true, false,
                                  false, false, true,
                                  false, false, false]</rosparam>

  <rosparam param="pose0_config">[true,  true,  false,
                                  false, false, true,
                                  false, false, false,
                                  false, false, false,
                                  false, false, false]</rosparam>

  <param name="odom0_differential" value="true"/>
  <param name="pose0_differential" value="false"/>

  <param name="print_diagnostics" value="true"/>

  <param name="debug"           value="false"/>
  <param name="debug_out_file"  value="debug_ekf_localization.txt"/>

  <rosparam param="process_noise_covariance">[0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]</rosparam>

       <rosparam param="initial_estimate_covariance">[0.3, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                      0,    0.3, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                      0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                      0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0 ...
(more)
2022-06-07 01:32:29 -0500 marked best answer Sequence of execution of move_base

Hi,

I have a mobile robot and would like it to navigate around the building. I already have a map of the building. I am using Wheel Encoders to generate odometry. I am feeding the output of Wheel encoders and IMU to robot_pose_ekf ( http://wiki.ros.org/robot_pose_ekf ) and then using AMCL for localization. Finally, I have the move_base package which plans the path and sends command velocities to the motors.
Assuming robot is at its starting position and it knows its path to the goal, my question is what is the sequence of steps after that:: ?
1. Local planner generates command velocities and sends its to the motors and then Wheel encoders start and generate odometry message which is fed into move_base. But again move_base needs some input odometry message, will that be just NULL to begin with?
2. Or, you give some initial default odometry message from wheel encoders to move_base which is used by move_base to generate command velocities and the cycle continues?

Hope I have made myself clear.

Thanks in advance.
Naman

2022-06-05 05:17:49 -0500 marked best answer baud rate parameter in rosserial_python arduino

Hi all,

I am trying serial communication between the Arduino and ROS using rosserial ( http://wiki.ros.org/rosserial ). It works perfectly with the default parameter for the baud rate:

rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0

but when I give a different baud rate using this:

rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=9600

I get the following error:

[INFO] [WallTime: 1428602466.003588] ROS Serial Python Node
[INFO] [WallTime: 1428602466.016732] Connecting to /dev/ttyACM0 at 9600 baud
[ERROR] [WallTime: 1428602483.124382] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

I have rosserial-indigo-devel installed and the ROS version is indigo. The above error comes only when you specify a baud rate other than 57600 (default baud rate).
I also looked into serial_node.py and changed the default baud rate to 9600 but then also, it only works with the baud rate of 57600 and gives error if some other baud rate is specified.

Does anyone know what can be the problem?

Thanks in advance.
Naman Kumar

2022-03-30 08:30:33 -0500 received badge  Nice Answer (source)
2022-03-05 13:08:58 -0500 marked best answer Merge the output of Ultrasound sensor with hokuyo laser output for navigation

Hi all,

I have a mobile robot and I would like it to navigate around the building. I already have a 2D map of the building. I have Rotational encoders to get the odometry information and IMU/UWB for localization. I will be using hokuyo laser sensor and Ultrasound sensors for navigation. Hokuyo will be the main sensor for navigation and Ultrasound sensors will be used to detect obstacles not seen by the hokuyo (like Overhangs, etc). So, my question is how can I merge the output of Ultrasound sensor which is of the type sensor_msgs/Range.msg with the hokuyo sensor output which is of the type sensor_msgs/LaserScan.msg ?
I think one of the ways can be to convert Range message to LaserScan message and then modify the original LaserScan message from the Hokuyo to incorporate this LaserScan message to come up with the final merged LaserScan message and use it for navigation. But I dont know how hard it will be specially merging of two LaserScan messages into one. Is there any other (easier or better) way to accomplish this? Or if this is the only way, what is the best way to go about it?

Thanks in advance.
Naman Kumar

2022-01-15 15:08:33 -0500 marked best answer IMU drift causing robot to drift in RVIZ

Hi all,

I am using Phidgets Spatial 3/3/3 IMU sensor along with rotary encoders to feed to the robot_pose_ekf. For IMU, I am using phidgets_imu and imu_filter_madgwick to get the sensor_msgs/Imu message. The problem is when I start the process and the robot is stationary at its start position, IMU starts drifting and the position of the robot in RVIZ starts changing (the actual robot is stationary). I have attached couple of images showing the change in position of the robot because of drift:

Initial position:

image description

After 7-8 mins (approx):

image description

I dont know whether this is normal or not. This only happens when I add IMU to the input of robot_pose_ekf, if I only have rotary encoders, everything looks OK. Also, I am not using magnetometer in the IMU and here is the relevant part of the code:

<!-- IMU -->
<node pkg="phidgets_imu" type="phidgets_imu_node" name="IMU_node1" output="screen">
    <param name="frame_id" value="base_link"/>
    <param name="period" value="32"/>
</node>
<node pkg="imu_filter_madgwick" type="imu_filter_node" name="IMU_node2" output="screen">
    <param name="use_mag" value="false"/>
    <param name="publish_tf" value="false"/>
    <param name="fixed_frame" value="odom_combined"/>
    <remap from="/imu/data" to="/imu_data"/>    
</node>

Does anyone has any insights on why is this happening and how can it be resolved? Please let me know if you need more information from me.

Thanks in advance.
Naman Kumar

2021-11-16 03:14:20 -0500 marked best answer How to subscribe a new costmap2dROS object to the global_costmap/costmap

Hi all,

I am planning to write my own node in ROS and I need to access the global_costmap which is being published. For that, I have created a new Costmap2DROS object:

int main(int argc, char** argv){

    ros::init(argc,argv,"publish_multiple_goals");
    ros::NodeHandle n;

    tf::TransformListener tf_(ros::Duration(10));

    costmap_ros_ = new costmap_2d::Costmap2DROS("my_costmap", tf_);
    costmap_ros_->start();

    costmap_ = costmap_ros_->getCostmap();

    return 0;
}

Now, I have a my_costmap_params.yaml file where I have specified the map_topic : /move_base_node/global_costmap/costmap (this is being published by move_base) so that the new costmap2DROS object subscribes to it:

my_costmap:
  #Set the global and robot frames for the costmap
  global_frame: /map
  robot_base_frame: /base_link

  #Set the update and publish frequency of the costmap
  update_frequency: 2.0
  publish_frequency: 2.0

  #We'll use a map served by the map_server to initialize this costmap
  static_map: true
  rolling_window: false

  use_dijkstra: false

  plugins:
  - {name: static_layer, type: "costmap_2d::StaticLayer"}
  - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
  - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

  static_layer:
    map_topic: /move_base_node/global_costmap/costmap

  #Configuration for the sensors that the costmap will use to update a map
  obstacle_layer:
    observation_sources: base_scan
    base_scan: {data_type: LaserScan, sensor_frame: /base_laser_link_1, topic: /base_scan, expected_update_rate: 0.4,
      observation_persistence: 0.0, marking: true, clearing: true, max_obstacle_height: 0.4, min_obstacle_height: 0.0}

I am loading the above parameters to parameter_server here:

publish_multiple.xml

<launch>
 <node pkg="publish_multiple_goals" type="publish_multiple_goals" respawn="false" name="publish_multiple_goals" output="screen">
    <rosparam file="$(find drsim_control)/move_base_config/my_costmap_params.yaml" command="load" />
  </node>
</launch>

Now the problem is it still subscribes to the "map" topic published by the map_server and does not subscribe to the map_topic I mentioned above that is /move_base_node/global_costmap/costmap using the costmap2DROS object I created above. I want to make sure that the costmap2DROS object created above subscribes to the map_topic to get the global_costmap. Does anyone have any idea what is going wrong here or what can I do to achieve the above mentioned task? Let me know if you need more information from me.

Update:
I think I am able to subscribe to the global_costmap but still when I use functions like: costmap_ros_->getRobotFootprint() , it gives me wrong readings (when I use this function in the global planner plugin, it gives me the correct values). Also, the Cost values of the costmap is either 0 or 254. Shouldn't the inflation be there according to http://wiki.ros.org/costmap_2d#Inflation ? Any help will be appreciated.

Thanks in advance.
Naman Kumar

2021-10-19 02:57:58 -0500 received badge  Good Question (source)
2021-08-04 11:47:39 -0500 marked best answer IMU initial orientation and drift problem

Hi all,

I am using Phidgets Spatial 3/3/3 along with this launch file. I have couple of doubts regarding it:
1. How is the initial orientation decided, is it always the same (default orientation) or is there any way to find the exact initial orientation?
2. When I use the magnetic orientation vector <param name="use_mag" value="true"/>, I have noticed that there is lot of drift when I rotate the IMU which does not happen when use_mag parameter is false. Can anyone tell me why is this happening or am I misinterpreting something?

Thanks in advance.
Naman Kumar

2021-06-11 07:26:26 -0500 marked best answer empty frame_id when converting sensor_msgs/PointCloud2 to sensor_msgs/Image

Hi,

I am using iai_kinect2(ROS Indigo and Ubuntu 14.04) to get a depth cloud from my Kinect2 in the form sensor_msgs/Image. Then, it is converted to sensor_msgs/PointCloud2 using depth_image_proc to do all the filtering operations using pcl. Finally, I want to convert the filtered point_cloud back to sensor_msgs/Image and for that, I am using pcl_ros/CloudToImage to get sensor_msgs/Image (on topic /kinect2/filtered_image). It compiled properly but during run time, when I try to visualize it in RVIZ, I get the following :

MessageFilter [target=kinect2_link ]: Discarding message from [unknown_publisher] due to empty frame_id.  This message will only print once.

When I do rostopic echo /kinect2/filtered_image, I get:

header: 
  seq: 2139
  stamp: 
    secs: 0
    nsecs: 0
  frame_id: ''
height: 1
width: 68227
encoding: bgr8
is_bigendian: 0
step: 204681
data: [0, 0, 181, 209, 216, 179, 207, 214, 179, 207, 214, 0, 0, 0, 175, 204, 211, 176, 205, 212, 176, 205, 210, 177, 206, 211, 0, 0, 0, 0, 0, 0, 179, 207, 214, 179, 208, 215, 181, 210, 217, 0, 0, 0, 178, 207, 214, 179, 208, 215, 180, 209, 216, 175, 204, 209, 175, 205, 210, 174, 203, 210, 0, 0, 0, 174, 203, 210, 175, 204, 211, 174, 203, 210, 176, 204, 211, 177, 205, 212, 0, 0, 0, 178, 207, 212, 180, 209, 214, 178, 206, 213, 179, 208, 215, 177, 209, 215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 209, 216, 174, 203, 208, 174, 203, 208, 176, 205, 210, 174, 203, 208, 175, 204, 209, 175, 205, 210, 175, 205, 210, 175, 204, 211, 175, 204, 211, 173, 205, 211, 172, 204, 210, 173, 205, 211, 173, 205, 211, 176, 205, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 179, 208, 215, 171, 203, 209, ....... ]

It looks like there is some problem here. It does not have any time stamp or frame_id. Also, the encoding is bgr8, shouldn't it be 16UC1?

EDIT :
As suggested in the answer, after copying the header from the input point cloud into the image and then if I visualize the published image in RVIZ, I get the following issue and RVIZ shuts down :

[ WARN] [1451938112.487114384]: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture ROSImageTexture0 face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at /build/buildd/ogre-1.8-1.8.1+dfsg/RenderSystems/GL/src/OgreGLTexture.cpp (line 420)
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'Ogre::RenderingAPIException'
  what():  OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture ROSImageTexture0 face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at /build/buildd/ogre-1.8-1.8.1 ...
(more)
2021-06-10 10:38:12 -0500 received badge  Good Question (source)
2021-05-17 02:20:15 -0500 received badge  Good Question (source)
2021-04-21 16:11:06 -0500 received badge  Great Question (source)
2021-02-17 12:42:38 -0500 received badge  Notable Question (source)
2021-01-21 19:09:54 -0500 marked best answer robot unable to rotate in place for dwa_local_planner

Hi all,

*UPDATED*

I am using dwa_local_planner as a local planner and is having some issues while the robot is turning (that is, rotating in place). The robot is able to go forward without any issues and is able to reach the goal within xy_tolerance and is able to rotate in place to correct its orientation so that it is within yaw_goal_tolerance. I have specified following parameters:

max_rot_vel: 1.0
min_rot_vel: 0.8

But I am having a problem when the robot has to go to the second goal once robot reaches the first goal and has to turn in place to move towards the second goal. The dwa_local_planner sends linear.x = 0.0 and angular.z = 0.31 in this case and hence the robot is unable to turn in place. This happens when min_trans_vel = 0.0. If I specify min_trans_vel as 0.1 or 0.2, then the robot is able to turn but in some cases, when the robot has to turn to go to the second goal, it is not able to turn and keeps on going straight at min_trans_vel till it reaches the wall and stops. It does not seem to have enough rotational velocity component.

I have specified min_rot_vel: 0.8 but it looks like the dwa_local_planner is not considering that. Is there any parameter similar to min_in_place_rotational_vel (which is there for TrajectoryPlannerROS) in case of dwa_local_planner which can be modified for in place rotation in case of dwa_local_planner? Or, does anyone have any idea why is this happening and how can it be solved?

dwa_local_planner_params.yaml

DWAPlannerROS:
  acc_lim_x: 2.0
  acc_lim_y: 0
  acc_lim_th: 3.0
  max_trans_vel: 0.5
  min_trans_vel: 0.0
  max_vel_x: 0.5
  min_vel_x: 0.0
  max_vel_y: 0
  min_vel_y: 0
  max_rot_vel: 1.0
  min_rot_vel: 0.8

  yaw_goal_tolerance: 0.17
  xy_goal_tolerance: 0.15
  latch_xy_goal_tolerance: false

  sim_time: 1.5
  sim_granularity: 0.025
  vx_samples: 10
  vy_samples: 0
  vtheta_samples: 20
  controller_frequency: 10
  penalize_negative_x: true

  path_distance_bias: 1.0
  goal_distance_bias: 0.8
  occdist_scale: 0.01
  forward_point_distance: 0.325
  stop_time_buffer: 0.2
  scaling_speed: 0.25
  max_scaling_factor: 0.2

  oscillation_reset_dist: 0.05

  prune_plan: false  

  sim_period: 0.1
  rot_stopped_vel: 0.01
  trans_stopped_vel: 0.01

Please let me know if you need more information from me. Any help will be appreciated.

Thanks in advance.
Naman Kumar

2020-11-16 08:19:34 -0500 marked best answer Clearing of obstacle layer in the layered_costmap

Hi all,

I have a layered_costmap with static_layer, obstacle_layer (for Lidar and Kinect) and inflation_layer and there are situations when I need to clear out the obstacle_layers manually in the code. I am working on full coverage and I want to clear out the obstacle layer when the robot reaches the goal and starts going to the next goal so that it can cover more area. What is the best way to clear out the entire obstacle layer and remove all obstacles (which are not in the static_map) manually in the code (maybe in move_base.cpp) ? I don't want to make any changes to the static_layer, just want to clear the obstacle_layer.

Update 1 :
I tried using /move_base/clearCostmapsService for which I added a piece of code in move_base.cpp itself (for now) so that I can test it by giving goals from RVIZ. I added the code in the executeCb function of move_base.cpp which gets called when a goal is received. Here is the code snippet :

void MoveBase::executeCb(const move_base_msgs::MoveBaseGoalConstPtr& move_base_goal)
      {
        if(!isQuaternionValid(move_base_goal->target_pose.pose.orientation)){
          as_->setAborted(move_base_msgs::MoveBaseResult(), "Aborting on goal because it was sent with an invalid quaternion");
          return;
        }


       ///// Added on 01/13/2016
       boost::unique_lock<boost::mutex> lock1(planner_mutex_);
       runPlanner_ = false;

      std_srvs::Empty srv;
      if(clear_costmaps_client.call(srv))
           ROS_INFO("I got the goal and the costmap layers are reset!!!!!");  // It prints this and continues but the costmap is not reset properly, it takes some time after this for the costmap to properly reset

      lock1.unlock();
      /////

        geometry_msgs::PoseStamped goal = goalToGlobalFrame(move_base_goal->target_pose);

        //we have a goal so start the planner
        boost::unique_lock<boost::mutex> lock(planner_mutex_);
        planner_goal_ = goal;
        runPlanner_ = true;
        planner_cond_.notify_one();
        lock.unlock();


    current_goal_pub_.publish(goal);
    std::vector<geometry_msgs::PoseStamped> global_plan;

Using the clearCostmapsService, the map is successfully cleared but the problem is that path planning is done before the map can filled with the static_layer (at this time, the map is basically empty and contains no obstacles) so the path is planned through the obstacles in the static_layer which I don't want. I want the costmap should be cleared and then filled again with static_layer and sensor_data and then path planning should be done. Does anyone have any idea what can be the issue in calling clearCostmapService shown in the code snippet above?

Thanks in advance.
Naman

2020-11-16 08:15:54 -0500 received badge  Nice Question (source)
2020-10-14 13:44:02 -0500 marked best answer Most recent transform in tf Tree

Hi all,

I want to ask that why the value of Most recent transform in my transformation tree so high? Does it mean that there is too much latency in generating the transformations? My tf tree:
image description

Thanks in advance.
Naman

2020-09-28 12:08:44 -0500 received badge  Nice Question (source)
2020-09-26 04:20:44 -0500 received badge  Favorite Question (source)
2020-09-11 12:26:56 -0500 marked best answer CMake error while integrating catkin workspace with qtCreator

Hi all,

I am trying to open a ros package in Qt Creator following http://wiki.ros.org/IDEs . In Qtcreator, I opened the CmakeLists.txt file from ~/catkin_ws/src and changed the build directory properly to ~/catkin_ws/build and then ran cmake. I am following this answer.

Also, I set the cmake arguments for devel and install directories properly which are inside catkin_ws using this line

-DCMAKE_INSTALL_PREFIX=/home/sharath/catkin_ws/install
-DCATKIN_DEVEL_PREFIX=/home/sharath/catkin_ws/devel

But when I run cmake in qtCreator, I get the following error:

CMake Error at /opt/ros/indigo/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/usr/bin/python
"/home/sharath/catkin_ws/build/catkin_generated/generate_cached_setup.py")
returned error code 1
Call Stack (most recent call first):
/opt/ros/indigo/share/catkin/cmake/all.cmake:186 (safe_execute_process)
/opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:52 (find_package)
File "/home/sharath/catkin_ws/build/catkin_generated/generate_cached_setup.py", line 20, in <module>
from catkin.environment_cache import generate_environment_script
ImportError: No module named catkin.environment_cache
Traceback (most recent call last):
-- Using CATKIN_DEVEL_PREFIX: /home/sharath/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH:
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/sharath/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.14
-- Configuring incomplete, errors occurred!
See also "/home/sharath/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/sharath/catkin_ws/build/CMakeFiles/CMakeError.log".

Here are the problems I am facing,

1) First of all , the above error appears . I tried updating the python modules by sudo pip install -U catkin_pkg but that does not help.

2) Also interestingly after running the cmake in qtcreator , my catkin_make doesn't run in the ~/catkin_ws

Now I cannot use ros aliases like roscore and stuff even though I have already sourced catkin_ws/devel/setup.bash and also /opt/ros/indigo/setup.bash in my bashrc. Restarted the terminal , but still catkin_make and aliases dont run. However this gets solved the moment I source again inside terminal for /opt/ros/indigo/setup.bash. This solves and now all ros commands work normally without sourcing only until I run Cmake from qtcreator and then ros commands dont work and need to be sourced again from terminal. Is the setup.bash in catkin_ws/devel getting modified or something ?

3) However my main problem is how to solve the qt creator error above.?

I tried setting up the workspace again but these problems recur in the same manner. There's something I am missing.

Update:
Thanks @Simon for the answer! I tried the "old_way" mentioned in the answer and replaced the CMakeLists.txt in the ~/catkin_ws/src/ with the file it links to. Then, I opened that CMakefile in qtcreator and specified build directory as ~/catkin_ws/build/ and then ran cmake and then, I get the same error as mentioned above. Now, when I run catkin_make ...
(more)

2020-08-14 16:37:16 -0500 received badge  Stellar Question (source)
2020-08-12 04:51:57 -0500 marked best answer Complete coverage path planning ros

Hi all,

I have a mobile robot with a Hokuyo Lidar, wheel encoders, IMU and couple of Sonar sensors. I have started working on the Complete coverage path planning and I am wondering if there is any package in ROS which can be used for this? I have searched and was not able to find anything. If there is no such package, what is the best way to proceed about it? I know this is a very general question but I am just looking for some pointers or references which might be helpful to start working on Complete coverage path planning?

Thanks in advance.
Naman Kumar

2020-08-06 02:36:02 -0500 received badge  Famous Question (source)
2020-07-28 09:10:05 -0500 marked best answer sending a sequence of goals to move_base

Hi all,

I have a mobile robot which is navigating around a room and it can go from start to goal without any issues. Now, I want to send a sequence of goals to move_base so that once the robot reaches its first goal, it automatically starts moving to its second goal and so on. One way which I can think of is to send a second goal when the robot reaches its first goal but how can I know that the robot has reached its first goal automatically? Does it publish anything on any topic once it reaches the goal or is any flag set or changed? Does anyone have any idea about how can it be done or is there a better way to send a sequence of goals to move_base so that the robot just keeps on going from one goal to another?

Any help will be appreciated.

Thanks in advance.
Naman Kumar

2020-06-23 06:58:13 -0500 received badge  Nice Question (source)