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

Hemu's profile - activity

2023-04-17 06:05:32 -0500 marked best answer Changing the size of the turtlesim window

How can I change the canvas width and canvas height of the turtlesim window displayed on running turtlesim_node? Are there some options which can be used with the command "rosrun turtlesim turtlesim_node __name:=turtle1" to change the size of the display window.

2018-09-18 19:50:25 -0500 marked best answer Dealing with errors in odometry when a robot moves up or down a slope

Hi all, Is there any algorithm/method to compensate the errors in Odometry (for dead reckoning) that might creep in when a robot moves up or down a slope? I am using a turtlebot which uses a kinect.

2018-03-16 22:35:38 -0500 marked best answer Problem in setting goal and monitoring (and controlling) movements using odometry

Hi all, I am trying to provide a goal to turtlebot (roomba base) in rectangular coordinates using /odom as the reference frame. I am trying to control and monitor the movements. The objective is to move along a straight line from initial position to final position (for the time being no obstacle avoidance required). There is a problem when I give negative destination coordinates (e.g. if robot is at (0,0) and I want it to move to (-1,-1) by first changing the yaw to the desired direction and then moving in the direction). When I calculate the yaw of the robot using its odometry (quaternion), its range is -1.57 to 1.57. However, I find the desired direction of motion using atan2(y,x) for destination (-1,-1) which requires yaw<(-1.57). So, the robot keeps rotating at its position. dest_x=x-coordinate of destination dest_y=y coordinate of destination end_dist= distance between current position and destination obj= geometry_msgs::Twist

      void odomcb(const nav_msgs::Odometry::ConstPtr& msg2)
    {
      ROS_INFO("Odometry Callback.");
      double x=msg2->pose.pose.position.x;
      double y=msg2->pose.pose.position.y;
      double Z=msg2->pose.pose.orientation.z;
      double W=msg2->pose.pose.orientation.w;
      curr_head=asin(2*Z*W);   //Current Heading
      ROS_INFO("Current Heading is %f",curr_head);
      end_x=dest_x+x;
      end_y=dest_y+y;
      if (!reached)
        heading=atan2(end_y,end_x);   //Desired Heading
      end_dist=sqrt((end_x*end_x)+(end_y*end_y));
      ROS_INFO("Distance to destination %f",end_dist);
      ROS_INFO("Required heading %f",heading);
    if (end_dist<=0.08)
        {
          heading=0.0;
          reached=true;
        }
      //curr_head=asin(2*Z*W);
      if (abs(curr_head-heading)>0.05)
        facing=false;
      else
        facing=true;
      if (!facing)
        {
          obj.linear.x=0;
          if (curr_head>heading)
            {
              if (curr_head-heading>0.5)
                obj.angular.z=-0.3;
              else if (curr_head-heading>0.2 && curr_head-heading<=0.5)
                obj.angular.z=-0.15;
              else if (curr_head-heading>0.05)
                obj.angular.z=-0.05; 
              else
                obj.angular.z=-0.01;
            }
          else
            {
              if (heading-curr_head>0.5)
                obj.angular.z=0.3;
              else if (heading-curr_head>0.2 && heading-curr_head<=0.5)
                obj.angular.z=0.15;
              else if (heading-curr_head>0.05)
                obj.angular.z=0.05;
              else
                obj.angular.z=0.01;
            }
        }
      if (facing && !reached)
        {
          obj.angular.z=0.0;
          if (end_dist>0.5)
            obj.linear.x=-0.2;
          else if (end_dist>0.2)
            obj.linear.x=-0.15;
          else if (end_dist>0.08)
            obj.linear.x=-0.05;
          else
            obj.linear.x=-0.00;
        }
      if (!facing && reached)
        {
          obj.linear.x=0.0;
        }
      if (reached && facing) 
//Robot has reached destination and returns to orientation (yaw=0) 
        {
          ROS_INFO("The robot has reached the destination.");
          obj.linear.x=0.0;
          obj.angular.z=0.0;
        }
      vel_pub.publish(obj);
    }

Can anyone suggest me a solution. Please do have a look at the callback function I have created (the kinect of turtlebot is facing in reverse direction. Hence, I had to use negative linear velocity as I wish to extend this code for obstacle avoidance).

Thanks

2018-03-16 22:35:38 -0500 received badge  Self-Learner (source)
2017-11-30 13:09:42 -0500 marked best answer Triggering a launch file using service and client nodes

I want to trigger a launch file using a client node when the service node returns a boolean value true. I have created a simple client and service. The response of the service node is a boolean variable. How can I trigger the launch file when the client receives true in the response for its request? I am using ROS Fuerte on Ubuntu 12.04.

2017-04-25 21:34:37 -0500 received badge  Famous Question (source)
2016-02-09 18:27:24 -0500 received badge  Famous Question (source)
2015-11-16 08:27:34 -0500 received badge  Famous Question (source)
2015-07-09 07:26:36 -0500 received badge  Notable Question (source)
2014-12-03 05:07:43 -0500 commented answer Difference between two transform broadcasters

That's what I did and it worked even when I set a different tf_prefix for each robot. However, using "map" with tf_prefix created two distinct frames /robot_1/map and /robot_2/map for each robot.

2014-12-02 13:00:11 -0500 received badge  Notable Question (source)
2014-12-02 12:17:32 -0500 commented answer Difference between two transform broadcasters

yes. that's true. Setting tf_prefix manually converts the frames to /tf_prefix/frame_name.

2014-12-02 12:17:17 -0500 commented answer Difference between two transform broadcasters

But as stated in the question,I am working on a multi-robot simulation with a common map while the simulated robots have their seperate odom and base_link frames.So, using a namespace and tf_pref allows me to distinguish between the frames of two robots.Hence,using /map allows me to use tf_prefix.

2014-12-02 06:55:16 -0500 received badge  Popular Question (source)
2014-12-02 06:44:22 -0500 commented answer Difference between two transform broadcasters

The first broadcaster provides me the desired common /map frame. The tf_prefix does not affect the name of map frame when declared as /map.

2014-12-02 01:07:22 -0500 asked a question Difference between two transform broadcasters

What is the difference between the following transform broadcasters in a multi-robot simulation:

1. br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "/map", "odom"));

2. br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "map", "odom"));

I have included the transform broadcaster in two namespaces: robot_1 (tf_prefix="robot_1") and robot_2(tf_prefix="robot_2"). I want to use a common map frame. Which of the above two command should I use to get transform of both robots w.r.t. global /map frame?

2014-11-11 03:43:20 -0500 commented answer amcl localisation on custom made bot

@Bhargav Try to find the transform between map and base_link using : rosrun tf tf_echo map base_link. Check whether the values are changing with robot's movements.

2014-11-05 11:49:54 -0500 commented answer amcl localisation on custom made bot

Let me look into that. I have not used depthimage_to_laserscan. I used pointcloud_to_laserscan.That's why I suggested you to publish a transformation between base_link and base_link_laser.

2014-11-05 11:30:10 -0500 commented question amcl localisation on custom made bot

Alternatively, you can just use [0 0 0 0 0 0 ] where last three terms would be roll, pitch and yaw.

2014-11-05 11:28:51 -0500 commented question amcl localisation on custom made bot

World frame is just a reference frame used for defining map frame. world is the parent frame and map is its child. the transform [0 0 0 0 0 0 1] the first three numbers are for translation and the remaining are for rotation ( quaternion has four parameters).

2014-11-05 11:24:12 -0500 commented answer amcl localisation on custom made bot

You are correct in saying that amcl provides transformation between map and odom but I think that amcl needs a well-defined map frame before it could publish a transform between the two frames.

2014-11-05 11:21:34 -0500 commented answer amcl localisation on custom made bot

@lebowski : In order to compute the transform between map and odom frames,we have to define the map frame. map_server publishes /map topic and does not define the map frame.I chose to have a world frame to define map frame relative to it. The world frame is just reference.

2014-11-05 11:08:05 -0500 commented question amcl localisation on custom made bot

@Bhargav Can you tell me if the "fixed frame" problem was solved or not?

2014-11-05 09:37:40 -0500 commented question amcl localisation on custom made bot

<node pkg="tf" type="static_transform_publisher" name="map_broadcaster" args="0 0 0 0 0 0 1 world map 100"/> Let me know if this solves your problem of "fixed frame does not exist". Similarly,I published a static transform between base_link(parent) and base_link_laser to avoid using camera frame.

2014-11-05 09:29:26 -0500 commented question amcl localisation on custom made bot

The view_frame file looks fine. You have got all the transforms needed. However, the amcl needs a transform between world coordinates and map coordinates as \map represents a fixed frame in the world. Add the following node in the launch file.

2014-11-05 07:35:41 -0500 received badge  Famous Question (source)
2014-11-05 06:18:33 -0500 commented question amcl localisation on custom made bot

Are you broadcasting a transform between /world and /map? If not, try again with a static transform between world and map.

2014-11-03 08:24:17 -0500 received badge  Nice Answer (source)
2014-10-13 13:24:18 -0500 received badge  Notable Question (source)
2014-10-13 04:03:54 -0500 received badge  Popular Question (source)
2014-10-13 03:54:04 -0500 commented answer Reading information from yaml document

My code is working now. And the dereferencing error was because I was passing a wrong argument as file name.

2014-10-12 00:49:32 -0500 received badge  Enthusiast
2014-10-11 06:30:03 -0500 asked a question Reading information from yaml document

I want to access the map information from map.yaml . Can I use the basic C++ file handling to read all the fields from the file? I tried using yaml-cpp but its instructions were clumsy and even if there were no compiler errors, I could not get rid of dereferencing errors during run time. Is there a tutorial on ROS to demonstrate how to read map data from yaml file?

2014-10-06 12:24:59 -0500 received badge  Famous Question (source)
2014-10-06 12:21:45 -0500 commented answer Using a library created using rosbuild_add_library

It worked. I will try using catkin_package command in CMakeLists for the packages built using catkin.

2014-10-06 12:18:17 -0500 received badge  Popular Question (source)
2014-10-06 07:59:15 -0500 commented answer Using a library created using rosbuild_add_library

I work with fuerte. So, it is manifest.xml. I just wanted a general idea whether the mentioned way of using the library in another package would work or not. Anyway, I will edit the question.

2014-10-06 04:59:05 -0500 asked a question Using a library created using rosbuild_add_library

I have created a package in ROS which contains my own header files and I have created a library using these header files using rosbuild_add_library (add_library in case of Catkin) . I wish to make use of this library in another ROS package. Is it enough to add the package ( containing my library ) to the list of dependency in package.xml (or manifest.xml) of the current package and using target_link_libraries( my_target my_library) in CMakeLists.txt or do I have to specify the complete path to my library? In other words, do I have to use link_directories(library_directories) even after adding my former package to the package.xml of the current package?

Pkg1 (package) contains a library foo. The library has been created using rosbuild_add_library on one computer and using add_library (for catkin) on another computer. Pkg2 is the package (created in both computers) in which I want to use the library foo.

2014-06-19 23:15:35 -0500 received badge  Notable Question (source)
2014-06-19 23:15:35 -0500 received badge  Famous Question (source)