Hello guys--I'm not sure whether I should be asking this here or on answers.ros.org, but I'd like to introduce myself here as well, so I figured I'd do both things in one post.
[ WARN] [1480694301.949696142]: Unable to get starting pose of robot, unable to create global plan
[ WARN] [1480694302.026249684]: Could not get robot pose, cancelling reconfiguration
[ WARN] [1480694302.282950941]: Unable to get starting pose of robot, unable to create global plan
[ WARN] [1480694302.616289437]: Unable to get starting pose of robot, unable to create global plan[ INFO] [1480694507.946145567]: Recovery behavior will clear layer obstacles
|
I've since dumped the rviz teleop, and reverted to the simple teleop_twist_keyboard package.
As mentioned before, both mapping and navigation occur on the i7 workstation, with no subscribers on the rpi, so I don't think bandwidth or memory should be a problem any more. But I still do need to send LaserScan messages from the rpi back to the workstation, which I imagine are a little heavier.
I assume that if you are running both gmapping and navigation at the same time that you are not running AMCL.
I prefer to run a dedicated microcontroller to interface to the motors. You can get better odometry and you can even put PID control loops in the micro to get real time control of the motors. In my setup I send actual velocity commands to the micro (in m/s and rad/s) and it scales to motor counts and performs closed loop control of the velocities. I also prefer to use a microcontroller with hardware quadrature decode as opposed to software quadrature decode. People do seem to make software decode work, but using hardware is one less thing to worry about.
"I suspect that some of my problems might just stem from poor build quality (my motor mounts are somewhat floppy), and dropping odometry data (my encoder interrupt-reading code is all in Python, and my interrupt services routines seem to take something like 3/100 sec, which is pretty terrible)."
I use an Atmel XMega chip on a custom board. I plan to port that over to a $12 TI TM4C123G LaunchPad when I have the ambition. But I don't have that yet.
It looks like ros_arduino_bridge might work:
https://www.youtube.com/watch?v=us9v9eIxH64
http://wiki.ros.org/ros_arduino_bridge
I haven't used it. Maybe Alan or Patrick could comment on that. I
would think it could be connected to your existing motor drivers.
Or somebody could figure out how to connect it if it is not
directly compatible. Also I don't recall if that expects the 3
channel quadrature decode shield or if the encoders can be
connected directly to the Arduino. But that would be an approach
with plenty of support.
The scooter tires should have a curved surface and give you a
smaller contact point, which will give better odometry data.
--
You received this message because you are subscribed to a topic in the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hbrobotics/fdwI0QruEMI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hbrobotics+...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to hbrobotics+unsubscribe@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+unsubscribe@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to hbrobotics+...@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.
--
Chris Albertson
Redondo Beach, California
--
You received this message because you are subscribed to a topic in the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hbrobotics/fdwI0QruEMI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hbrobotics+...@googlegroups.com.
|
I use RPi.GPIO.add_event_detect to register an interrupt service routine. Not sure which "select" function you mean.
You can see the code here: https://github.com/tsbertalan/gunnar/blob/master/src/gunnar/motor.py
In this commit you can see the transition from full resolution to quarter: https://github.com/tsbertalan/gunnar/commit/9250481221e56eb189a8d0ba7af5bf42bc1c51cc
Which driver are you tweaking?
--
You received this message because you are subscribed to a topic in the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hbrobotics/fdwI0QruEMI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hbrobotics+...@googlegroups.com.
I'll put a little more effort into attempting to handle encoders on the rpi, and then try the launchpad or mbed. I suppose the idea would be to use a simple serial hand-designed bytesteam to communicate with the uP? It would check for input and send encoder totals every 10 ms or so; otherwise be sleeping for ISR callbacks.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+unsubscribe@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+unsubscribe@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.
That is the board that I plan to use. I got as far as initializing one quadrature decode and printing the 32 bit position value. Then I got distracted. I started with the Energia development system, which is an Arduino compatible IDE. I haven't decided if I should continue that way or switch to Code Composer Studio.
I'll go back to porting my XMega controller to the TM4C123G board and see how far I get...
- Jeff Sampson
Mkae sure you have the 123 and not the 120. The 120 didn't have quadrature or PWM.
It has two quadrature channels and they probably run at least
2Mhz input. (I didn't look it up.)
Great discussion! I can say that I have used the
ros_arduino_bridge package for a few years now with good results.
The master branch now includes support for the 3-axis Robogaia
encoder shield which is what I use on a couple of robots, one with
an Arduino Uno and the 3-axis encoder shield and one with a Mega
and the older 2-axis encoder shield. If you look at the
documentation on Github you'll see that others have added
support for connecting encoders directly to an Arduino Uno without
a shield though I haven't tried that myself.
The PID loop is run on the Arduino.
BTW, the ros_arduino_bridge package also has support for analog
and digital sensors as well as PWM servos. Rather than running as
a ROS client node like rosserial, ros_arduino_bridge treats the
microcontroller as a slave device and the host PC polls it at a
chosen frequency to get the latest values from sensors and
encoders. These values are then published as ROS topics and, in
the case of odometry, as a transform between the odom frame and
the base_link frame.
--patrick
-- The Pi Robot Project http://www.pirobot.org/wordpress
Bob and Chris again,
> All you need is the period of the last two edges to get a period and speed estimate.
So, I suppose using average speed as the number of ticks elapsed divided by the PID period would unnecessarily low-pass the true speed data (though this might actually be desirable). Does this mean I need to check the time at every interrupt?
> whether period or frequency based
I don't know the terminology here. Is the first where you check the time at every interrupt, potentially causing trouble when motors are stopped or barely creeping? And the second is where you divide elapsed ticks by elapsed time in a slower loop?
>> On another topic: If interrupts really are taking 0.03 seconds how
>> is the rover even working at all with pulses coming at 3,000 per
>> second?
I didn't get a chance to time this evening. Had to watch the season premiere of Westworld with some friends. 😀 But I have hope, justified by my reasonable-looking odometry paths (coming directly from my own code, not gmapping), that my earlier timing was wrong. Watch this space.
--
You received this message because you are subscribed to a topic in the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hbrobotics/fdwI0QruEMI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hbrobotics+...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hbrobotics/fdwI0QruEMI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hbrobotics+...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+unsubscribe@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.

This morning I wired up a new Arduino Uno clone with an Adafruit motor controller V2.3 and the Robogaia 3-axis encoder shield. I then tested the latest master branch RAB code and it appears to work fine. HOWEVER, at one point I also ran into the problem of only one motor turning. In my case it was caused by a poor connection on one of the motor terminals--it looked OK, but when I removed the lead and reconnected it, things started working again.
--patrick
-- The Pi Robot Project http://www.pirobot.org/wordpress
--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+unsubscribe@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.
Chris,
Yes, that stood out to me as well. I briefly tried it both ways, and I think the encoder actually incremented the correct direction both times, though much faster with the declarations inside the ISRs. I'll need to do some more careful testing, as well as just read the code more carefully. I'm new to the bitwise math.
I tried to use RAB for odometry and motor control this morning while gmapping and running the path planning stack, but it didn't seem to be working. My suspicion is that the LIDAR, arduino, and WIFI dongle weren't coexisting well on the USB bus.
Tom
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.
--
Chris Albertson
Redondo Beach, California
--
You received this message because you are subscribed to a topic in the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hbrobotics/fdwI0QruEMI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hbrobotics+...@googlegroups.com.
Well no, since ros_arduino_bridge was written for Arduino, it
made sense to compile it under an Arduino-like environment. So I
used Energia which is designed for the TI boards.
I didn't try anything under CCS, because I couldn't get any of the download links to work. But I just now did another search and found CCS7 for Linux. I will see if that installs.
Just casually looking through ros_arduino_bridge it looks like the motor/encoder/PID (at least the way I did the motor and encoder) doesn't use a lot of Arduino functions. But you would have to create your own start up code and supply your own serial and timer functions. My motor and encoder modules should compile under CCS.
But all of the "extra" functions are going to drop right in.
(like pin configuration, servo, analog read, ping, etc.)
I'll see if I can get CCS to install. And then I'll get back you...
- Jeff Sampson
Jeff, thanks for your scouting. At the moment, I'm getting pretty good results with just an Arduino, but once I fix the ROS-originating problems detailed below, I think it's pretty likely that I'll return to the 32-bit ucontrollers in the hopes of improving odometry and high-update-rate PID. RAB has given me great success today--read on...
After adding a debug command to RAB's command.h, I was able to notice that my left encoder's wires were connected to my right encoder's pins, and v/v. After fixing that, I get good PID and odometry, though I suppose the wheel/wheel base geometry parameters could perhaps be tuned slightly.
I made some new videos this evening showing move_base results with the new embedded odometry source and PID speed control. It's significantly better than the RPi results were, but the leftward list is still apparent in the first video:
https://youtu.be/La1HR6EwuGI
I found, however, that this bias can be fixed by setting min_vel_theta to the negative of max_vel_theta. I had assume that those were absolute rotational speed limits, but it looks like they're actually signed---I was explicitly disallowing right turns.
However, after fixing that (and also modifying some other parameters with the goal of making movement more slow and deliberative), an underlying problem becomes more clear--the local planner keeps trying to backtrack to the root of the global plan for some reason, like an old man who keeps thinking he forgot something. This sound like just the sort of problem that the prune option is supposed to fix, but that's on by default, and turning it on explicitly didn't help anything.
https://youtu.be/itdsMdsVfCY
https://youtu.be/1LCFzeLqWfs
I've been trying various parameter tweaks on this, but haven't fixed anything. My next focus will be reading the path planning code and perhaps recompiling it with various debug prints, unless something obviously wrong jumps out to any of you about what might be wrong with my path planning. I'm traveling for a week starting tomorrow, but I might still be able to get some testing in remotely, with the help of a local assistant to do battery recharges!
Tom
I should also note that I did move the encoder memory declarations to outside the ISRs as Chris and I discussed, and gave them separate names for right and left (though in principle one of the two ISRs could be modified to use the top four bits of enc_last, and the other can continue to use the bottom four bits, I figured I'd leave this optimization til later). I'll look into doing a pull request with lesser change in a couple days here.
I'm writing this on a flight, and I spent the first hour or so of the flight reading a PDF called "ROS Navigation Tuning Guide", by Kaiyu Zheng. This gives a lot better documentation of many of the parameters of the navigation stack than is available on the wiki, though there are still some holes. Notably, It says that:
(1) I can set negative values for the minimum translational (x) velocity, to allow for backing up. Perhaps then at least, when he feels the need to go back to the start of the global plan, he can do so without two 180* rotations (which at the moment are often done not in-place, resulting in lots of lost ground). However, Zheng notes that negative values min_vel_theta are not respected by DWA, without clarifying exactly what min_vel_theta means in that case. Is it the absolute minium speed magnitude (to account for static friction)--a parameter which then is simply not available in DWA alternatives? Does DWA not allow right turns??
(2) When using navfn or global_planner, I can use cost_factor and neutral_cost to create global plans which use more right-angle turns to avoid taking oblique paths through doorways and openings, by avoiding costmap hotspots. Zheng also gives rules of thumb for tuning inflation radius and cost_scaling_factor for good performance in hallways which I'll try out.
I have some doubts about whether my parameter changes up to this point all were actually taking effect. It's not super clear which ns keyword parameter I should provide when loading my yaml files into launch files, or whether to group parameters under a subsection such as TrajectoryPlannerROS (can't remember the exact name) within the yaml files. My hope is that I can do a launch with my parameter files commented out, then use rqt_reconfigure to get some guidance on where the default values are showing up.
I'll try to test some of these ideas out when I finish flying for today, and get to a place where I can SSH into my robot. I also brought my new cache of 32-bit ucontrollers (tiva c, mbed, and teensy) with me, FWIW. Maybe I'll play with them some as well; likely not.
Tom
My code runs on the small cheap $13 EK-TM4C123GXL Launchpad.
I set to negative because I read somewhere that, like the minimum theta velocities, it should be signed. You may recall that I had Zoolanderesque problems when min_vel_theta was positive. I've changed min_vel_x to 0.05, and the stalling seems to have stopped. I suppose the original problem for this thread is comprehensively solved at this point. I'm not a very experienced forumite; is it etiquette to stop posting to the thread at this point? I'll make it a point to give a more serialized treatment to this project on tomsb.net
Tom
-- The Pi Robot Project http://www.pirobot.org/wordpress