Ask Your Question

randylewis7's profile - activity

2019-06-30 23:26:53 -0500 received badge  Nice Question (source)
2018-01-30 21:35:38 -0500 marked best answer ax2550 motor controller calibration for ros node compatibility?

Hello, I'm using a ROS driver for the ax2550 motor controller found here:

https://github.com/wjwwood/ax2550

I have plugged the device into a serial-->usb converter, which then goes into my computer. However, when I run the node using:

rosrun ax2550 ax2550_node /dev/ttyUSB0 (this is the port its connected to)

I get the error:

[ INFO] [1405453884.235150040]: AX2550 connecting to port /dev/ttyUSB0
[ERROR] [1405453886.236099864]: Failed to connect to the AX2550: Synchronization Exception: did not receive an R/C message after reset, file /home/randy/catkin_ws/src/toro/src/ax2550.cpp, line 315.
[ INFO] [1405453886.503068921]: Will try to reconnect to the AX2550 in 5 seconds.

I emailed the author of the node, and he told me that the device has to be configured in a specific way to work with the node, but that he doesn't specifically remember how. I am attempting to look through this document to try to understand the code/how it expects the device to be configured/how to configure it this way, but am not making much progress because I don't really understand most of the document. Anyone know what settings I should be trying to change?

2017-04-20 16:55:08 -0500 marked best answer How to make a copy of all data contained within a ROS topic message?

Hello, I'm trying to write a node that subscribes to the kinect data from multiple turtlebots, then concatenates/averages the data, and republishes the resulting single data stream to rviz as part of a larger program intended to map a room cooperatively with multiple turtlebots at once.

I've already written a node that subscribes to kinect data from multiple turtlebots, but now am struggling with the republishing. I have several callback methods that are call every time a message is published on a certain topic, and within each of these callback methods, I would like to copy all the data contained within the message to a temporary global variable which can then be accessed in the main class. However, the only way I can think of to do this is to go through and manually copy each individual piece of data from the message to the global variable. Is there a simpler way to do this? For example, is there a command that I could use to create a copy of each message within each callback function, which I could call and then just modify whatever parts I wanted to modify, instead of having to manually copy each data piece?

Edit: Yes, I am using C++. Here is the odometry (location/heading) callback function. RIght now it just prints out the relevant data:

void OdomCallback(const nav_msgs::Odometry locator)
{
  ROS_INFO("Position: %f,%f", locator.pose.pose.position.x,locator.pose.pose.position.y);
  ROS_INFO("Heading: linear:%f,angular:%f", locator.twist.twist.linear.x,locator.twist.twist.angular.z);
}

So you're saying that in order to copy the message I would add in a line like this? nav_msgs::Odometry globalLocationVariable=locator;

2017-03-19 18:52:41 -0500 received badge  Nice Question (source)
2016-08-14 01:54:43 -0500 marked best answer How to go about getting raw data from turtlebot kinect sensor?

Hello, I'm trying to create a program that will have a turtlebot map a given area. However, I am very new to this. I understand that the turtlebots publish some kind of point cloud as sensed by the kinect, but I don't understand exactly how to subscribe to this data, and what type it is so that I can work with it to create a map.

Anyone have any suggestions or know any good tutorials that could help me out?

2016-06-28 22:16:27 -0500 marked best answer LMS1xx driver connecting to scanner but not actually scanning?

Hello, I am using a SICK LMS151 laser scanner that I am trying to set up with ROS. I downloaded this driver:

https://github.com/clearpathrobotics/...

initially just with sudo apt-get, but that didn't download all the correct files, so I ended up creating my own LMS1xx directory, and copying all the text from the package.xml, CMakeLists, nodes, launch files, etc. directly into the files on my computer. THen I compiled it with catkin_make (no errors), and ran it with my laser scanner plugged in (with the correct ip address). Everything seemed to be going correctly; it said it connected to the laser at the correct ip address, but then it proceeded to not do anything else. I thought this driver was supposed to run laser scans and print the data, so I checked the LMS1xx_node file, and I saw that indeed, after printing that ROS has connected to the laser, the node is supposed to do other things ti (that look to me like performing scans, but I' not sure).

In between the command to print "connected to laser" and the scan loop however, I see the following code:

do //wait for ready status { stat = laser.queryStatus(); ros::Duration(1.0).sleep(); }

while (stat != read_for_measurement);

So apparently for some reason the laser is not returning a ready status to the node, and thus the scans are not beginning. Anyone know why this could be? I am running ROS hydro on ubuntu 12.04 on virtualbox on windows 7 (maybe this is the problem, if the virtual machine is somehow messing up the laser/computer communication).

Thanks,

Randy

2016-06-15 20:55:17 -0500 received badge  Famous Question (source)
2016-05-08 14:59:53 -0500 marked best answer How to make a loop that runs every time ros node receives a message?

Hello, I'm trying to write a node that subscribes to a topic, then, in the callback function for the subscriber, saves each message received in a global variable (one that is overwritten each time a new message is received), and that manually republishes the messages on a different topic name every time the a message is received (like a node for manually remapping a topic). I realize that this node isn't useful in itself, but it is part of a larger program and I have to get it working before I can get the larger program working.

Does anyone know how to make a loop or event or some qualifier that I can put code inside that will run every time I receive a message on a specific topic in ROS? For now I just measured the average hz of the topic I'm subscribing to, and then set the loop rate of the publishing loop equal to that average, but I would like something more exact.

2016-03-16 18:07:58 -0500 marked best answer ax2550 node fails to connect to ax2550?

Hello, I'm using a ROS driver for the ax2550 motor controller found here:

https://github.com/wjwwood/ax2550

(I couldn't figure out the actual download, so I just created my own project and copied the text into each file, then catkin_made. I don't think this is the source of my problems, since it compiled, and worked for a similar device driver that I got working just yesterday.)

I have plugged the device into a serial-->usb converter, which then goes into my computer. However, when I run the node using:

rosrun ax2550 ax2550_node /dev/ttyUSB0 (this is the port its connected to)

I get the following response:

[ INFO] [1405371811.620859117]: AX2550 connecting to port /dev/ttyUSB0
[ERROR] [1405371811.621207096]: Failed to connect to the AX2550: IO Exception (13): Permission denied, file /tmp/buildd/ros-hydro-serial-1.1.7-0precise-20140617-0339/src/impl/unix.cc, line 150.
[ INFO] [1405371811.621317396]: Will try to reconnect to the AX2550 in 5 seconds.

It looks like this is a permissions error (despite the fact that I am the administrator), but I don't know for sure and if it is I don't know how to change these permissions. Anyone got any ideas?

Thanks

New info:

I ran the line sudo chmod 777 /dev/ttyUSB0, which solved the error I was initially having. However, I am now encountering a new error when I try to run the node: [ INFO] [1405453884.235150040]: AX2550 connecting to port /dev/ttyUSB0 [ERROR] [1405453886.236099864]: Failed to connect to the AX2550: Synchronization Exception: did not receive an R/C message after reset, file /home/randy/catkin_ws/src/toro/src/ax2550.cpp, line 315. [ INFO] [1405453886.503068921]: Will try to reconnect to the AX2550 in 5 seconds. Any idea what could be causing this one?

2016-03-15 15:06:00 -0500 received badge  Famous Question (source)
2016-01-21 07:05:29 -0500 received badge  Notable Question (source)
2016-01-21 07:05:29 -0500 received badge  Popular Question (source)
2016-01-21 07:05:29 -0500 received badge  Famous Question (source)
2016-01-20 12:46:43 -0500 marked best answer How to publish messages with specific data types for arguments?

Hello, I've adapted some C++ control code for a smart motor I have attached to a laser scanner (it rotates the laser scanner back and forth) into a node to do the same thing upon receiving a custom message. The message includes start/end angle, speed, and duration, which are the inputs the original control code uses:

  float32 start
  float32 end
  float32 speed
  float32 duration

The node compiles and runs (the code as is can be found here: http://pastebin.com/wypDERQL ). Now I am trying to complete a simple back and forth sweep for 3 seconds, by publishing a custom Sweep message to the /sweep topic from the command line. I run the command:

  rostopic pub -1 /sweep toro/Sweep -- -3.14159/2 3.14159/2 3.14159/2 3

but get the following response (repeated many times):

 [WARN] [WallTime: 1408045951.800915] Inbound TCP/IP connection failed: <class 'struct.error'>: 'required argument is not  a float' when writing 'start: -3.14159/2
 end: 3.14159/2
 speed: 3.14159/2
 duration: 3'

Is there any kind of way I can specify the data type of the arguments while publishing the message? I guess they might be doubles by default, but ros custom messages don't support doubles (or at least I couldn't get them to work), so I don't think I can fix the problem on that end.

2016-01-20 07:25:25 -0500 received badge  Famous Question (source)
2015-11-23 21:50:34 -0500 received badge  Famous Question (source)
2015-09-03 19:17:59 -0500 received badge  Necromancer (source)
2015-09-03 19:17:59 -0500 received badge  Teacher (source)
2015-08-20 19:27:55 -0500 received badge  Good Question (source)
2015-08-20 19:27:42 -0500 marked best answer How to get the line "source devel/setup.bash" to run after every time you catkin_make?

I have "source devel/setup.bash" added to my bashrc file, but sometimes, if I create a new package and then compile it for the first time with "catkin_make", then I find I need to open a new terminal in order to run the package because the terminal I already have open needs to source devel/setup.bash again.

Does anyone know how to get "source devel/setup.bash" to run every time I do catkin_make? Or otherwise how to solve this problem?

2015-08-18 01:31:01 -0500 received badge  Popular Question (source)
2015-08-18 01:31:01 -0500 received badge  Notable Question (source)
2015-08-17 11:18:14 -0500 received badge  Famous Question (source)
2015-05-06 06:14:23 -0500 received badge  Famous Question (source)
2015-05-05 01:47:22 -0500 received badge  Famous Question (source)
2015-03-31 03:04:41 -0500 received badge  Famous Question (source)
2015-03-31 03:04:41 -0500 received badge  Notable Question (source)
2015-03-31 03:04:41 -0500 received badge  Popular Question (source)
2015-03-09 13:51:38 -0500 received badge  Famous Question (source)
2015-02-16 08:13:38 -0500 marked best answer Executable built from multiple source files?

Hello, I am working on setting up a robot I have in ROS, using ROS drivers written by others. Specifically, I'm using an LMS151 laser scanner and an ax2550 motor controller, with the drivers found here:

https://github.com/clearpathrobotics/... https://github.com/wjwwood/ax2550

While inspecting the code inside these projects, I noticed that they both have a similar format: a cpp file labeled <device>.cpp, and another labeled <device>_node.cpp. Then they both build their executable from both cpp files, using the line

add_executable(<device>_node src/<device>_node.cpp src/<device>.cpp),

which is what I don't understand. How does building one executable from two files work? How does the compiler combine the two into one program? It must somehow work, because both of the authors do it, and I've gotten one of the nodes (the LMS1xx one to work already), but I don't understand how.

2015-02-16 08:13:36 -0500 received badge  Famous Question (source)
2015-02-06 07:34:03 -0500 received badge  Popular Question (source)
2015-02-06 07:34:03 -0500 received badge  Notable Question (source)
2015-01-27 10:01:59 -0500 marked best answer Trouble Including rosbag

Hello, I am trying to follow this tutorial: http://wiki.ros.org/rosbag/Code%20API... , but am running into errors with the inclusion of rosbag. When I try to run the example code, I get a jillion lines of errors all saying something like this: undefined reference to rosbag:somethingOrOther. However, I don't know what I'm doing wrong. I included rosbag/bag.h and rosbag/view.h in my C++ source file, and I believe I've linked the libraries correctly in my CMakelists file:

add_executable(rosbagger src/rosbagger.cpp) target_link_libraries(rosbagger ${catkin_LIBRARIES})

Anyone know whats going wrong?

2014-12-23 16:01:38 -0500 received badge  Notable Question (source)