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

petern3's profile - activity

2017-01-23 21:04:09 -0500 answered a question Hardware to run ROS on a PC ?

ROS itself does not 'need' any sensors, as it is a framework that programs and drivers can communicate on rather than a program.

If you want your robot to interact with the world, then yes your robot needs sensors. In general the more sensors, the better. If you only want to simulate the robot, you can with RVIZ and Gazebo (or turtlesim for starters).

2017-01-23 17:24:06 -0500 commented answer How can I open a new terminal and execute a rosrun command through a cpp program ?

No problem, hopefully the tutorials are able to kickstart your project!

2017-01-23 06:12:06 -0500 received badge  Enlightened (source)
2017-01-22 13:50:40 -0500 commented answer SLAM with a camera without odometry

I haven't used the Kinect myself, so I don't know for sure. If you can't get the depth stream from the camera you could try installing both, otherwise I think openni2 will do the trick.

2017-01-19 17:30:28 -0500 received badge  Good Answer (source)
2017-01-19 16:47:38 -0500 received badge  Nice Answer (source)
2017-01-19 15:33:27 -0500 answered a question How can I open a new terminal and execute a rosrun command through a cpp program ?

Not recommended

To run any shell commands from a cpp program, you can use the std::system function. ie

#include <cstdlib>  // I think 'system' is in here?

int main(void) {
    std::system("rosrun [package] [node]");  // replace [package] and [node] with the relevant text

    return EXIT_SUCCESS;
}

This won't work unless the master node is running (i.e you have called roscore or roslaunch first)

Recommended

Normally when you want to start a node, you run all the nodes you'll need in the program using a launch file. Instead of generating new nodes during runtime, you could also create services. The Cpp API gives you basically all the interfaces you'll need.

I would highly recommend doing the tutorials. They take ages, but go a long way to understanding ROS.

Also, before posting a question next time, look for the answer first, and if these don't answer your question, follow the support guidelines. A more descriptive title might be "How to execute rosrun command from cpp", then the informal text can go in the text body.

2017-01-18 20:27:39 -0500 commented answer SLAM with a camera without odometry

If you're just doing this, then you won't need to use RGBDslam. It's a good option, as 2D path-planning is much easier.

2017-01-18 20:24:43 -0500 commented answer SLAM with a camera without odometry

I've had a quick look around, and found http://wiki.ros.org/depthimage_to_las... , which should be able to be used with something like gmapping. There's also this tutorial, although it may be outdated.

2017-01-16 19:00:32 -0500 answered a question Localization SLAM how to do?

I'd suggest having a poke around the relevant topics. As long as you know that it is actually making a goal, have a look at all the topics between the goal and rviz, because it's getting lost somewhere (each topic will tell you which nodes are listening, and the nodes will tell you what they're sending).

For example: Is it sending the goal? Is it creating a path? Does cmd_vel get the message (and is it sensible)? Is rviz looking at the correct topic?

If you can find out where it goes wrong, you can have a more detailed look. Hopefully it's just something simple like rviz is looking at /cmd_vel instead of /my_autonomous_car/base_controller/cmd_vel or something.

2017-01-16 17:08:06 -0500 answered a question SLAM with a camera without odometry

Question 1

There is a library called RGBDslam which can use the Kinect, and doesn't require odometry. This has been tested on Fuerte and Indigo, and the github repository also has a Kinetic branch.

For the ros wiki page: http://wiki.ros.org/rgbdslam

For the github repo: https://github.com/felixendres/rgbdsl...

Question 2

I assume if the above works you don't need to fake the laser scanner?

Question 3

According to a forum, the power supply is rated for 12V, 2.67A. 12V batteries are not uncommon, but you'll have to be a bit more careful about the 2.67A rating. You may also need to solder your own connectors.

2017-01-06 18:46:25 -0500 received badge  Nice Answer (source)
2016-11-30 13:45:12 -0500 received badge  Enthusiast
2016-11-29 15:45:03 -0500 answered a question simulate UAV motor-off after a while

This is a bit of a shot in the dark since I don't know anything about your system, but if there is some topic that the motor is subscribed to (maybe throttle), then you can manipulate that. (If you're lucky, there might be a service you can call instead).

Find out what topics are there with rostopic list, and if any look relevant, call rostopic info [/path/to/topic] to see what's subscribed to it. Alternatively if you know the node, rosnode info [node] will tell you what it's subscribed to.

You'll need to poke new values into the topic. If something is continuously publishing into the topic, you could change the publisher topic write your own node to act as a on/off valve. That is:

original_publisher(node) -> target_throttle(topic) -> throttle_on_off(node) -> actual_throttle(topic) -> original_subscriber(node)

You can do what you like with your node, such as stopping forwarding on the messages after 5s. You could possibly get away with not even subscribing to the target_throttle topic if you know what if should be.

2016-11-29 15:27:05 -0500 commented question Interrupt a callback to start one other

What kinds of problems are you having, and what are you trying to achieve? I assumed that callbacks can run concurrently.

2016-11-29 07:11:03 -0500 received badge  Teacher (source)
2016-11-28 16:38:47 -0500 answered a question Node Specific Parameters in YAML

The yaml is not associated with any particular node, but more to do with namespaces. That is, a yaml that looks like:

settings:  # Arbitrary settings
  camera:
    format: "jpeg"
  wheels:
    max_speed: 3.0
    min_speed: 0.2

would create three values in the parameter service. If you type in rosparam list, you would get:

/settings/camera/format
/settings/wheels/max_speed
/settings/wheels/min_speed

(You can get the actual values with rosparam get [param]).

The point of this is that a node can get any of these parameters. In your launch file, instead of putting the <rosparam> tag inside the node (which I understand you have), you can have it at the top. Something like:

<launch>
  <rosparam file="$(find package1)/config/settings.yaml" command="load" />
  <node pkg="package1" type="node1" name="node1" />
</launch>
2016-11-28 16:19:59 -0500 answered a question Subcribing to the Odometry

Because the nav_msgs/Odometry is a different message type from turtlesim/Pose, you might have to write yourself a node to convert the two. Before you do that, check to see if there isn't already a topic publishing the pose you want.

Fortunately one of the values of Odometry is a Pose (see rosmsg show nav_msgs/odometry), unfortunately this is a geometry_msgs/Pose rather than a turtlesim/Pose (use rosmsg show [msg] to see what each contains). They are different, most notably the turtlesim Pose does not use a quaternion.

I hope this helps!

2016-11-27 14:45:41 -0500 answered a question Hi, how can I subscribe the node(topic cmd_vel) of turtlesim to the node of my model?

via command line:

You can remap topics with /old_topic:=/new_topic. In your case:

rosrun turtlesim turtlesim_node /turtle1/cmd_vel:=/my_gazebo_robot/cmd_vel

via launch file:

Within the node, you can use the remap tag.

<node pkg="turtlesim" type="turtlesim_node" name="sim">
  <remap from="/turtle1/cmd_vel" to="/my_gazebo_robot/cmd_vel" />
</node>

You can check if either method worked with rostopic list and rostopic info /my_gazebo_robot/cmd_vel. Note that /my_gazebo_robot might be several directories deep (such as if you have a base controller).

2016-11-24 03:05:53 -0500 received badge  Editor (source)
2016-11-23 19:58:37 -0500 answered a question Subscribe to two topics and performing some computation

In the publish/subscribe example in the ROS tutorials, it shows about the simplest a subscriber can get (example).

There are two things required for a subscription, that is the callback function, and the subscriber handle. You can simply duplicate these as many times as you need. A modified example could be:

#include "ros/ros.h"
#include "std_msgs/String.h"
#include "std_msgs/Int16.h"


void fooCallback(const std_msgs::String::ConstPtr& msg)
{
  // process the string
}

void barCallback(const std_msgs::Int16 msg)
{
  // process the int
}

int main(int argc, char **argv)
{
  ros::init(argc, argv, "listener");
  ros::NodeHandle n;

  ros::Subscriber sub1 = n.subscribe("foo", 1000, fooCallback);
  ros::Subscriber sub2 = n.subscribe("bar", 1000, barCallback);

  ros::spin();

  return 0;
}

I haven't tested this, so you probably can't just copy and run it.

2016-11-23 19:13:55 -0500 received badge  Supporter (source)
2016-11-23 19:08:46 -0500 answered a question Hello guys, Has anyone used the evaluation scripts provided in RGBDSLAM_v2 with the .bag files obtained directly from the package GUI?

The first (and possibly only) problem is package 'rgbdslam' not found. This means that ROS does not know about the rgbdslam package. This problem has been asked before.

If you have rgbdslam in a catkin workspace somewhere, make sure you have built it (with catkin_make install) and sourced it (with source path/to/workspace/devel/setup.bash).

If that error goes away and it still doesn't work, the bag/ground truth files may be in the wrong place. The error should tell you somewhere!