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

jlo's profile - activity

2021-06-22 01:57:49 -0500 received badge  Great Question (source)
2017-04-27 15:59:58 -0500 received badge  Good Question (source)
2016-10-28 14:57:06 -0500 received badge  Nice Question (source)
2016-06-29 01:37:23 -0500 received badge  Nice Question (source)
2016-06-28 03:03:25 -0500 marked best answer Adding more than one path to ROS_PACKAGE_PATH?

Hi there, I have the following problem when I try to add more than one path to my ROS_PACKAGE_PATH in my .bashrc. Like this it won't cause any problems

export ROS_PACKAGE_PATH=/home/alonsoj1/ros_workspace/:$ROS_PACKAGE_PATH

but when I try to include more than one, f.i.:

export ROS_PACKAGE_PATH=/home/alonsoj1/ros_workspace/:/home/alonsoj1/ros/

it doesn't work and this is the kind of messages I get when I try to rosmake something:

alonsoj1@aut-228:~/ros_workspace/beginner_tutorials$ rosrun beginner_tutorials talker.py Traceback (most recent call last): File "/home/alonsoj1/ros_workspace/beginner_tutorials/nodes/talker.py", line 2, in <module> import roslib; roslib.load_manifest('beginner_tutorials') File "/opt/ros/electric/ros/core/roslib/src/roslib/launcher.py", line 75, in load_manifest sys.path = prefix + _generate_python_path(package_name, [], os.environ) + sys.path File "/opt/ros/electric/ros/core/roslib/src/roslib/launcher.py", line 131, in _generate_python_path raise roslib.packages.InvalidROSPkgException("While loading package '%s': %s"%(d.package, str(e))) roslib.packages.InvalidROSPkgException: While loading package 'std_msgs': Cannot locate installation of package std_msgs: [rospack] couldn't find package [std_msgs]. ROS_ROOT[/opt/ros/electric/ros] ROS_PACKAGE_PATH[/home/alonsoj1/ros/stacks:/home/alonsoj1/ros_workspace]

Also, when I try to self-complete (with TAB, I mean), I get something like this (FIXED, I had two trailing slashes at the end of the paths, I would have never guessed it would have mattered):

roscd beg[rospack] warning: trailing slash found in ROS_PACKAGE_PATH [rospack] warning: trailing slash found in ROS_PACKAGE_PATH [rosstack] warning: trailing slash found in ROS_PACKAGE_PATH [rosstack] warning: trailing slash found in ROS_PACKAGE_PATH

Any ideas? Thanks!

2015-02-09 08:00:32 -0500 received badge  Nice Answer (source)
2014-09-11 18:34:57 -0500 marked best answer Help programming a simulation in stageros.

Hi, I want to program a simulation with stage, where I'd like a robot to move forward till he detects an obstacle, and then, turn until he can continue forward. For that I know I have to subscribe to scan topic and to publish to cmd_vel to make the robot move (thanks, Martin Günther!). But I don't know how to interact with stage itself. I think I could manage to write the subscribe and publish algorithms with what I learnt from the publisher's and subscriber's tutorials, but once that is done, I'm at a loss as to how execute the simulation. I read some of this link, but I'm still really lost. Any suggestions?

Thanks!

2014-08-26 17:11:27 -0500 marked best answer Help publishing to cmd_vel and subscribing to LaserScan

Hey guys, I am trying to program a publisher for cmd_vel and a subscriber of base_scan (sensor_msgs/LaserScan, specifically the array ranges). For the first one I know I have to give a command like this:

rostopic pub /cmd_vel geometry_msgs/Twist -r 10000 '[10, 0, 0]' '[0, 0, 5]'

I have tried giving it to the command prompt, and it works. Now, including that in a publisher (I have tried modifying the "talker" one of the tutorials - from here). The thing is I don't know how to modify it to include the command I want to give to it. I tried changing the following line to:

ss << "/cmd_vel geometry_msgs/Twist -r 10000 '[10, 0, 0]' '[0, 0, 5]'";

that belongs to this loop

  while (ros::ok())
  { std_msgs::String msg;
    std::stringstream ss;
    ss << "/cmd_vel geometry_msgs/Twist -r 10000 '[10, 0, 0]' '[0, 0, 5]'";
    msg.data = ss.str();
    ROS_INFO("%s", msg.data.c_str());
    chatter_pub.publish(msg);
    ros::spinOnce();
    loop_rate.sleep();
    ++count;
  }

But as expected, changing just the string to the command I want to give didn't work. There probably is a really simple way of doing it, but I don't know how.

As for the second task, the subscriber to LaserScan, I know that I have to use the ranges array to visualize the meters to the obstacles, but first of all I don't know how to visualize the array in the command prompt. Once I know that with the previous task answered, I may be able to find out how to do it.

Thanks a lot for all the help and support! (not only here but in all the questions I've been having lately!)

2014-08-05 05:34:35 -0500 marked best answer Where can I get .world files for stage?

Is there any repository where I can get them? I would like to simulate in different maps.

Thanks,

2014-06-02 01:34:06 -0500 marked best answer ROS_INFO vs printf?

Hi there, I was wondering what the differences were between ROS_INFO and printf. In the tutorials it is referred as the equivalent to printf/cout. Any reason why it had to be implemented?

Cheers,

2014-04-20 13:08:58 -0500 marked best answer How to include my own libraries in cmake to compile with rosmake?

Hi there, I am working in a thesis where I have to use ROS within a system (and the other way round). So far, what I have changed in the CMakeLists.txt is including the following lines:

rosbuild_add_executable(ROSPublisher2MaCIClient ROSPublisher2MaCIClient.cpp)
include_directories(../../../../include/utils)
target_link_libraries(${GIMUtils} ../../../../lib/libGIMutils.a)
include_directories(../../../../include/MaCI)
target_link_libraries(${MaCI} ../../../../lib/libMaCI.a)    
include_directories(../../../../include/GIMI)
include_directories(../../../../include/GIMnetAP)
include_directories(../../../../include)
target_link_libraries(${GIMI} ../../../../lib/libGIMI.a)
include_directories(/usr/include/libxml2)
TARGET_LINK_LIBRARIES(xml2)
add_definitions(-DLINUX_OS)

But there's no way it's working. I get a lot of "undefined reference" errors and I don't have an idea of how to fix it. That's why I was wondering: Is this the way to do it? (at least, so far the lines I have included in the CMakeLists.txt or is there something I'm missing (or some other file I have to update to make it all work with rosmake).

Cheers,

2014-04-20 12:42:00 -0500 marked best answer Rviz 2D alternative?

Hey there, I would like to use a 2D User Interface for ROS, does it exist? As far as I'm concerned, rviz is the only there is (because gazebo/stage are simulators). Why do I want to use something else than rviz? Mainly, because even specifying the topic of the data (position, laser ranging, speed control), it doesn't recognize it. From the troubleshooting page from RVIZ I found out I have to include my data into a tf, something that sounds very complicated and (maybe) unnecessary.

Is there any way out? And if there's not, any tutorials on how to turn my data/topic into a tf?

Cheers,

Update: On a nutshell, what I'm doing is fairly simple: 3 different cases of sending data through topics in ROS (one topic). I have a task_talker and a task_listener (based on the tutorial codes, just modifying the type of messages sent). Task_talker publishes the parameter into the topic and task_listener subscribes to it. The different tasks are as follows (with its parameters):

  1. Position sending using geometry_msgs/Pose2D
  2. Laser ranging sending using sensor_msgs/LaserScan
  3. Speed Control using geometry_msgs/Twist.

I would post the code as well, but it also includes a different OS from ROS that would only further confuse readers.

2014-04-20 12:41:46 -0500 marked best answer Documentation/references on how ROS works internally?

Hey, I am doing a project for my Uni involving ROS and in one of the chapters of the thesis I should talk about the state-of-the-art of ROS (i.e. how it really works internally). Are there any documents that describe this? In the papers section I can only find information about specific experiments, not the ROS system itself.

Cheers,

2014-04-20 12:40:56 -0500 marked best answer Problems modifying teleop_base_keyboard.

Hey there, I wanted to try out a code that sends Twist/cmd_vel parameters over a topic. Therefore, I tried simplifying the code for teleop_base_keyboard (available here) with this code.

When I run it, instead of just taking in my keystrokes and not displaying them on screen, it does and I have to push enter to see the printf on what's being sent (right after the chatter_pub.publish(cmdvel); line). And even then, the values never change. I get the feeling it's never entering in any cases apart from the default one. What's displayed is:

Reading from keyboard
---------------------------
w/x : increase/decrease max linear speed by 10%
e/c : increase/decrease max angular speed by 10%
---------------------------
anything else : stop
---------------------------
wwww
The speed information sent is: 
 Linear speed x 0.000000  
  Angular speed z 0.000000  
w
 The speed information sent is: 
 Linear speed x 0.000000  
  Angular speed z 0.000000  
 The speed information sent is: 
 Linear speed x 0.000000  
  Angular speed z 0.000000

Any input on what I'm doing wrong?

Thanks :)!

2014-04-20 12:40:22 -0500 marked best answer Renaming a package

Hi there, I created a package named 'A'. After a while, I wanted to create package 'B' that would be exactly the same as A, just changing some parts of the source code. Is there a way I can:

  1. Rename the package A (so that roscd will recognize the new name for A)
  2. Copy-paste A's folder, rename it and make roscd recognize it (as let's say, package 'B')

Otherwise, the only solution I can think of is roscreating the packages again. I'm sure there's a wiser alternative.

Thanks! :)

Update: felix_k's answer works, but you have to execute 'rospack profile', so that ROS can register you have changed the names. Great! Thanks everybody.