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

ajain's profile - activity

2021-09-06 00:10:55 -0500 received badge  Good Question (source)
2019-04-12 03:27:38 -0500 received badge  Nice Question (source)
2018-09-10 07:35:31 -0500 received badge  Famous Question (source)
2018-02-08 02:52:41 -0500 received badge  Notable Question (source)
2017-11-03 08:34:42 -0500 received badge  Popular Question (source)
2017-11-02 17:41:41 -0500 commented question Does rosbag c++ api write to memory or disk?

Thanks, I looked into the code for both. nodelet_rosbag may be the right approach.

2017-11-02 13:04:15 -0500 asked a question Does rosbag c++ api write to memory or disk?

Does rosbag c++ api write to memory or disk? I am writing a ROS node that triggers rosbags using a service. I am trying

2017-10-15 10:49:32 -0500 received badge  Famous Question (source)
2017-03-27 16:23:55 -0500 received badge  Notable Question (source)
2017-01-19 01:35:11 -0500 received badge  Popular Question (source)
2016-12-15 12:37:41 -0500 asked a question dynamic reconfigure callback happens automatically when a node is launched without rqt client

I am using dynamic_reconfigure in my node to adjust some params dynamically. I found that the first callback for dynamic reconfigure happens when the node is launched, specifically when I define the callback for dynamic reconfigure in my constructor. This causes my node to reject param values defined in my launch file and take in default values defined in cfg file for dynamic reconfigure.

I would expect the callback to happen only when I launch rqt_dynamic_reconfigure which sets up a client, not when I set up the server in my node. At least a regular ROS server and client works this way, not callback on server side until a client makes calls to that server. In the implementation of dynamic reconfigure, is there a way to not have the callback happen when server is set up and only change param values when I launch rqt_dynamic_reconfigure?

2016-11-02 00:02:31 -0500 commented answer Creating Packages of ros-<distro>-package_name type

Yes. You can install rules to copy any directory into your /share directory of install like this -

install(DIRECTORY launch/
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch)

This will copy all files inside /launch directory of your package to /share/<pkg_name>/launch .

2016-11-01 20:03:24 -0500 answered a question Creating Packages of ros-<distro>-package_name type

Do catkin_make --install. This will create an install directory and put all your package binaries, launch files and config files in /lib and /share respectively. You can zip this install folder and unzip it in a different catkin workspace. Make sure you copy /lib into /opt/ros/lib and /share to /opt/ros/share.

2016-03-30 09:27:23 -0500 received badge  Nice Answer (source)
2016-03-29 19:38:01 -0500 received badge  Nice Question (source)
2016-03-21 06:32:54 -0500 received badge  Self-Learner (source)
2015-12-25 10:29:14 -0500 received badge  Famous Question (source)
2015-12-11 13:30:13 -0500 received badge  Student (source)
2015-07-26 19:25:59 -0500 received badge  Nice Answer (source)
2015-07-02 20:08:13 -0500 received badge  Famous Question (source)
2015-06-17 03:56:25 -0500 received badge  Notable Question (source)
2015-05-29 13:27:51 -0500 received badge  Famous Question (source)
2015-05-29 10:16:01 -0500 received badge  Popular Question (source)
2015-05-28 10:38:21 -0500 commented question Saving geotiff map in Hector_slam

Please check logs of hector_geotiff node. Also, could you please share your output for rostopic list.

2015-05-28 10:34:39 -0500 answered a question Complete SLAM Implementation

There are many pre-existing SLAM packages available in ROS. Each has different performances. Most packages have easy integration tutorials on ROS wiki.

The most common 2D SLAM packages are - gmapping, hector_slam, MRPT slam

For 3D SLAM, I haven't found a lot of support but here are a couple that might be useful. Some of them are not supported for ros-indigo so you might have to modify a little bit - RGBD slam, ICP

2015-05-18 16:54:56 -0500 asked a question Exception thrown while processing service call: Time is out of dual 32-bit range

I am doing a very simple implementation of ROS service. There are two nodes, server and client node and the only main variable is that I am using rosbags for streaming data used by callback method on server side. I am getting the following error on some callbacks -

Exception thrown while processing service call: Time is out of dual 32-bit range

Can someone throw some light on why am I getting this error and how can I fix this for my service callback to work properly?

2015-05-18 03:15:00 -0500 received badge  Famous Question (source)
2015-04-14 03:46:40 -0500 received badge  Famous Question (source)
2015-03-16 13:35:16 -0500 received badge  Enlightened (source)
2015-03-13 10:49:23 -0500 received badge  Famous Question (source)
2015-01-28 02:31:36 -0500 received badge  Notable Question (source)
2015-01-24 08:46:02 -0500 received badge  Notable Question (source)
2015-01-20 07:20:10 -0500 received badge  Popular Question (source)
2015-01-19 18:51:14 -0500 asked a question How to update map to odom with corrections from SLAM ?

Our basic goal is to publish a map to odom transform that corrects for the drift of our odometry. We have a localization algorithm that uses landmarks to give an absolute position wrt the map frame. Our problem so far has been with how to best achieve this using the tf library.

The strategy we are trying right now looks like:

//Get newPose
tf::Pose newPose = getPoseFromLandmarks();
//Get difference between current pose (which may be different than previous getPoseFromLandmarks because of odom updates) and newPose
tf::Transform poseDifference = currentPose.inverse() * newPose;
//Apply that difference to our current map to odom transfrom
tf::Transform newMapToOdom = poseDifference * currentMapToOdom;
//Now broadcast the transform and we're done

This was working fine up until we started calculating rotation in getPoseFromLandmarks(). When we apply rotation to the newPose, the poseDifference as well as the newMapToOdom values are not as we expect. It seems that the rotation happens before the translation (e.g. {x,y,z of poseDifference} != {x,y,z currentPose} - {x,y,z newPose}). This usually causes the corrections to accumulate and our x,y,z quickly goes to infinity.

We have tried every combination we could think of to make this work; right vs left multiply, changing what we inverse and where, calculating translation difference separately from rotation difference. The only successful strategy we have had is to manually calculate the difference in the pose origins, manually calculate the difference in the yaw of both poses (which works since we are only updating the robots yaw for now), and then manually apply these results to the currentMapToOdom transform.

//Get the difference in translation and yaw 
poseDifference.setOrigin(newPose.getOrigin() - currentPose.getOrigin());
poseDifference.setRotation(tf::createQuaternionFromYaw(tf::getYaw(newPose.getRotation()) - tf::getYaw(currentPose.getRotation())));

//Apply the difference to correct mapToOdom
newMapToOdom.setOrigin(currentMapToOdom.getOrigin() + poseDifference.getOrigin());
newMapToOdom.setRotation(tf::createQuaternionFromYaw(tf::getYaw(currentMapToOdom.getRotation()) + tf::getYaw(poseDifference.getRotation())));

While this works, it feels really hacky and won't work roll/pitch corrections. It seems like there should be a more elegant way to achieve this with TF math, or maybe a better strategy for calculating the corrected mapToOdom transform?

Any help would be appreciated, thanks in advance.

Edit: The second approach is correct way to solve the problem.

2015-01-05 13:21:07 -0500 answered a question How to calculate /tf in hector_slam?

Firstly, hector_slam is independent of /tf for laser (watch this video). You can simply have a laser attached to a computer and walk around to create a 2D map. I haven't used the bag file that you mentioned before, but usually the bag file should contain time stamped /tf data, or simply create a urdf.xacro config file for your system and load it using robot_state_publisher to publish transforms.

2015-01-05 12:41:14 -0500 marked best answer Use PTZ controls on Axis Camera

I have an Axis camera (AXIS M5014 PTZ) and I am using axis_camera package to get the video stream. The video stream using axis.py works perfectly fine.

Now I am trying to use axis_ptz.py node to control PTZ parameters of the camera. Firstly, there is barely any documentation on this page explaining how you can actually set the parameters for dynamic configuration. After some research I found that rosrun rqt_reconfigure rqt_reconfigure opens a GUI for you to set parameters on different available variables. Now, only "pan" variable works, and "tilt" doesn't do anything. Are there and examples/tutorials/documentation that can help me out?

2015-01-05 12:40:34 -0500 marked best answer Multiple nodes providing same service, which one will get through (many to one services)

I am trying a very simple task. I have a 2D laser scanner and 3D velodyne laser on my robot and I want to create an assembled point cloud which includes data from both lasers in one point cloud. I am trying to have laser_assembler package do all the work with laser_scan_assembler and point_cloud2_assembler nodes, which both provide services of same name /assembled_point_cloud which is of the same type sensor_msgs::PointCloud.

The problem I'm facing is that my temp_service_call_node only subscribes to one service (the one provided by point_cloud2_assembler), and gets no data from laser_scan_assembler. Also, if I kill the velodyne node, so that no point cloud2 data is published for point_cloud2_assembler, it doesn't change anything. /assembled_point_cloud which instead of showing only 2D laser scan data when no point cloud2 data is available, keeps subscribing to the point_cloud2_assembler which doesn't give any data.

Is there anything I'm missing or a different approach that I can try?

Please see code for reference-

Here's my launch file:

<launch>
    <node type="laser_scan_assembler" pkg="laser_assembler" name="laser_scan_assembler">
        <remap from="scan" to="/laser/scan"/>
        <remap from="assemble_scans" to="assembled_point_cloud"/>
        <param name="max_scans" type="int" value="1" />
        <param name="fixed_frame" type="string" value="base_link" />
    </node>

    <node type="point_cloud_assembler" pkg="laser_assembler" name="point_cloud_assembler">
        <remap from="cloud" to="/laser/point_cloud"/>
        <remap from="assemble_scans" to="assembled_point_cloud"/>
        <param name="max_clouds" type="int" value="1" />
        <param name="fixed_frame" type="string" value="base_link" />
    </node>

     <node type="point_cloud2_assembler" pkg="laser_assembler" name="point_cloud2_assembler">
        <remap from="cloud" to="/laser/point_cloud2"/>
        <remap from="assemble_scans" to="assembled_point_cloud"/>
        <param name="max_clouds" type="int" value="1" />
        <param name="fixed_frame" type="string" value="base_link" />
    </node>
</launch>

temp_service_call.cpp file:

void publishPointCloud2()
{
    //Wait for service to start
    ros::service::waitForService("/assembled_point_cloud");

    ros::Rate r(updateRate);

    while(ros::ok())
    {
        assemblerService.request.begin = assemblerService.request.end;
        assemblerService.request.end   = ros::Time::now();
        if (assemblerClient.call(assemblerService))
        {
            pointCloud = assemblerService.response.cloud;
                    sensor_msgs::convertPointCloudToPointCloud2(pointCloud, pointCloud2);

            ROS_INFO("Got cloud with %u points\n", assemblerService.response.cloud.points.size());
        }
        else
        {
            ROS_ERROR("Service call for getting assembled laser scan failed\n");
        }

        if (pointCloud2.data.size() > 0)
            pointCloud2Publisher.publish(pointCloud2);

        ros::spinOnce();
        r.sleep();
    }
}
2015-01-02 00:11:00 -0500 received badge  Famous Question (source)
2015-01-01 01:55:37 -0500 received badge  Taxonomist