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

popolvar's profile - activity

2013-07-06 03:41:57 -0500 received badge  Famous Question (source)
2012-11-29 23:10:39 -0500 received badge  Famous Question (source)
2012-08-29 09:18:58 -0500 received badge  Notable Question (source)
2012-08-21 01:45:45 -0500 received badge  Popular Question (source)
2012-08-21 01:45:45 -0500 received badge  Notable Question (source)
2012-08-20 17:11:12 -0500 received badge  Popular Question (source)
2012-07-31 02:12:46 -0500 received badge  Supporter (source)
2012-07-31 02:12:33 -0500 received badge  Scholar (source)
2012-07-30 23:22:41 -0500 asked a question Placing permanent visual marker in rviz

Hi there,

I would like to place a visual marker representing the goal line (through which the robot should pass) in rviz. IMHO, this code should do the trick

#include <ros/ros.h>
#include <visualization_msgs/Marker.h>

int main( int argc, char** argv )
{
  ros::init(argc, argv, "goal_marker");
  ros::NodeHandle n;
  ros::Publisher marker_pub = n.advertise<visualization_msgs::Marker>("visualization_marker", 1);

  // Set our initial shape type to be a cube
  uint32_t shape = visualization_msgs::Marker::ARROW;

  visualization_msgs::Marker marker;

  // Set the frame ID and timestamp.  See the TF tutorials for information on these.
  marker.header.frame_id = "/map";
  marker.header.stamp = ros::Time::now();

  // set other marker properties
  ...
  // set other marker properties end

  marker.lifetime = ros::Duration();

  // Publish the marker
  marker_pub.publish(marker);

}

However the marker does not appear in rviz. So in practice I end up doing this (based on Markers:Sending Basic Shapes)

int main( int argc, char** argv )
{
  ros::init(argc, argv, "goal_marker");
  ros::NodeHandle n;
  ros::Rate r(100);
  ros::Publisher marker_pub = n.advertise<visualization_msgs::Marker>("visualization_marker", 1);

  // Set our initial shape type to be a cube
  uint32_t shape = visualization_msgs::Marker::ARROW;

 for (int x=0; x<2; x++){
    visualization_msgs::Marker marker;

    // Set the frame ID and timestamp.  See the TF tutorials for information on these.
    marker.header.frame_id = "/map";
    marker.header.stamp = ros::Time::now();

    // set other marker properties
    ...
    // set other marker properties end

    marker.lifetime = ros::Duration();

    // Publish the marker
    marker_pub.publish(marker);

    r.sleep();
  }
}

Both the two iterations and the r.sleep are necessary, after their removal the marker does not appear in rviz. Any ideas why the first approach doesn't work and second does?

Would appreciate any help. Cheers!

2012-07-28 05:35:29 -0500 asked a question Turtlebot navigation with TurtlebotMoveAction much slower than with MoveBaseAction

Hi there,

I was trying to move Turtlebot by one meter in Gazebo. I have spawned a world, created its map and followed sending simple MoveBaseGoal tutorial. The robot moved one meter as expected.

If the code is modified to use the TurtlebotMoveAction instead of MoveBaseAction as in

typedef actionlib::SimpleActionClient<turtlebot_actions::TurtlebotMoveAction> MoveBaseClient;

int main(int argc, char** argv){
  ros::init(argc, argv, "turtlebot_move_action_client");

  //tell the action client that we want to spin a thread by default
  MoveBaseClient ac("turtlebot_move_action_server/turtlebot_move", true);

  //wait for the action server to come up
  while(!ac.waitForServer(ros::Duration(5.0))){
    ROS_INFO("Waiting for the turtlebot_move action server to come up");
  }

  turtlebot_actions::TurtlebotMoveGoal goal;
  goal.turn_distance = 1.0;
  goal.forward_distance = -1.0;

  ROS_INFO("Sending goal");
  ac.sendGoal(goal);

  bool finished_before_timeout = ac.waitForResult(ros::Duration(36000.0));

  if (finished_before_timeout)
  {
    actionlib::SimpleClientGoalState state = ac.getState();
    ROS_INFO("Action finished: %s",state.toString().c_str());
  }
  else
    ROS_INFO("Action did not finish before the time out.");
  return 0;
}

The robot appears to be doing nothing. Following the /turtlebot_move_action_server/turtlebot_move/feedback reveals that the robot actually does steadily progress to the goal, but it is extremely slow.

It moves about 25cms in 10 hours or so in contrast to the MoveBaseAction version which travels one meter in less than a minute.

Any thoughts why this is the case or possible errors?

Cheers!