PDA

View Full Version : ArbotiX ROS Stack 0.4.0



lnxfergy
02-11-2011, 09:57 AM
0.4.0 is out! This is a major update as we refine the API, looking towards an 1.0 release. There are some major changes, outlined below:


The "arbotix" package is now a stack -- the package with the python drivers is "arbotix_python".
The driver does sync_write -- this really speeds things up. A number of internal changes also speed things up -- you must update your firmware.
The joint_state publication now includes a computed velocity
Each servo now has a <servo>/command topic, of type Float64, which specifies the position to move the servo to.
The arbotix_controllers package includes joint_controller.py and traj_controller.py which take JointState messages, and JointTrajectory messages, and turn them into individual command topics. See http://ros.org/wiki/arbotix_controllers for parameters and details. Please note, there is not yet speed interpolation in either of these controllers -- I recommend setting a low max_speed for each servo in your YAML, which will interpolate and limit speed at the driver level. A release will fix this shortly. IF USING CTURTLE, YOU NEED TO INSTALL TRAJECTORY_MSG -- IN DIAMONDBACK/UNSTABLE, IT IS COMMON_MSGS.
We have a whole new analog/digital subsystem, based on setting up individual streams. The old service-oriented architecture is gone. Streams can be started either in the YAML, or via a service call. See http://ros.org/wiki/arbotix_python/io
The arbotix_sensors package includes an ir_ranger.py program which will start an analog stream and then subscribe and republish range messages. THIS REQUIRES THE DIAMONDBACK/UNSTABLE VERSION OF SENSOR_MSGS PACAKGE.

How to update your Launch/YAMLs from 0.3.x:


Replace all pkg="arbotix" with pkg="arbotix_python"
Replace all type="arbotix-node.py" with type="driver.py"
If you previously set a rate parameter, rename this read_rate
The default baud is now 115200, if you want to still use 38400 (recommended for wireless connections), be sure to add a baud parameter to your yaml or launch file.
If you still want to use "cmdJoints" topic with joint_states, you'll need to spin up a joint_controller.py in your launch file (there is no longer a joint_controller in the arbotix driver):
<node name="head_joint_controller" pkg="arbotix_controllers" type="joint_controller.py">
<rosparam param="joints">[head_pan_joint, head_tilt_joint]</rosparam>
</node>
If using a base controller, you have to modify your parameters as there is no longer a controllers collection. This:
controllers: {
bc: {type: base_controller, base_width: 0.2, ticks_meter: 500}
}
would be come this:
base: {base_width: 0.2, ticks_meter: 500}
Same for PML, this:
sensors: {
pml: {type: pml, servo_id: 1}
}
becomes this:
pml: {servo_id: 1}
Analog/Digital has completely changed -- see the wiki page (which I'm still updating): http://ros.org/wiki/arbotix_python/io

This is still an 0.4.0 release, so there may be bugs -- please report any issues. I'm expecting to be rapidly cranking out releases over the next week or two. I've been using this pretty extensively on Maxwell, and also on a test robot on my desktop -- so the base_controller is well tested. Analog/Digital have been pretty well tested. I briefly tested PML, and still need to do further testing on the hobby servo control.

You can checkout the code using:
svn co http://vanadium-ros-pkg.googlecode.com/svn/tags/arbotix/0.4.0 arbotix

-Fergs

Pi Robot
02-11-2011, 03:39 PM
Congrats Fergs! And here I am stuck at work without an ArbotiX to try it out on. Can't wait to fire it up this weekend. Will report back how it goes.

BTW, you no doubt already know about this, but the UA stack has sample action controllers written in Python at:

http://ua-ros-pkg.googlecode.com/svn/trunk/arrg/ua_controllers/wubble_actions/nodes/

Thought it might be a good place to start unless you are already cooking up your own.

--patrick

Peter_heim
02-11-2011, 03:56 PM
Hi Fergs

The "arbotix" package is now a stack -- the package with the python drivers is "arbotix_python".
What is the difference between stack and package? and dose this change the way its installed?


peter

lnxfergy
02-11-2011, 04:22 PM
Hi Fergs

What is the difference between stack and package? and dose this change the way its installed?

peter

The main consideration here is that stacks are versioned, and are the standard unit of release. By doing this, the arbotix stack is now standalone and able to be versioned independently of any of our other drivers.

The second reasoning behind the name changes is to delineate "arbotix_python" as the python version of the arbotix drivers. There may in the future be an arbotix_cpp alternative....

Installation-wise, it mainly means that we install from tags/arbotix instead of tags/vanadium_drivers. For the most part, the changes are in how your launch files are setup as I've majorly cleaned up a number of the interfaces -- and also reduced the number of threads in the program (which really improves reliability).

-Fergs

lnxfergy
02-13-2011, 11:08 PM
And, we've already got an 0.4.1 release. I found a very serious bug in the interpolation code that broke "inverted" outputs. Updates for this release include:


[arbotix_controllers] add interpolation to trajectory and joint controllers.
[arbotix_python] add support for diagnostic_msgs output.
[arbotix_python] fix grave bug in interpolation.

I'll be documenting the preliminary support for diagnostics in a day or so. Basically, this allows you to use the robot_monitor GUI to see temperatures/voltages of each servo, and also see the encoder values. I'll be adding more debugging/logging info to this over time.

-Fergs

Pi Robot
02-15-2011, 08:00 PM
Hey Fergs,

I finally have a few moments to dive into 0.4.1. One small thing I ran into is I think the code:





<node name="head_joint_controller" pkg="arbotix_controllers" type="joint_controller.py">
<rosparam name="joints">[head_pan_joint, head_tilt_joint]</rosparam>
</node>

Needs to be:


<node name="head_joint_controller" pkg="arbotix_controllers" type="joint_controller.py">
<rosparam param="joints">[head_pan_joint, head_tilt_joint]</rosparam>
</node>
the only change being the use of the "param" keyword instead of "name" in the <rosparam...> line.

With this in place, I can bring up driver.py and joint_controller.py without error. Next, I thought I would be able to move the head pan servo with a command like:


rostopic pub /head_pan_joint/command std_msgs/Float64 1.0but the servo does not move. Should it? I am assuming the argument is in radians but I tried it with higher values in case it is degrees or servo ticks.

Thanks!
patrick

lnxfergy
02-15-2011, 08:16 PM
Hey Fergs,

With this in place, I can bring up driver.py and joint_controller.py without error. Next, I thought I would be able to move the head pan servo with a command like:


rostopic pub /head_pan_joint/command std_msgs/Float64 1.0but the servo does not move. Should it? I am assuming the argument is in radians but I tried it with higher values in case it is degrees or servo ticks.

Thanks!
patrick

Ok, I updated my first post, thanks for catching that.

The command is indeed in radians -- and publishing to that should move it. The controllerGUI has been updated to control directly on the command topics, could you try if that works?

-Fergs

Pi Robot
02-15-2011, 08:36 PM
OK, controllerGUI.py is definitely publishing to the command topics as I can verify using "rostopic echo" but the servos don't move and there are no errors in rxconsole. Perhaps there is something wrong with my YAML file which is:



port: /dev/ttyUSB0
baud: 57600
read_rate: 5
use_sync: True

dynamixels: {
head_pan_joint: {id: 1, max_speed: 360, min_angle: -145, max_angle: 145, invert: True},
head_tilt_joint: {id: 2, max_speed: 360, min_angle: -60, max_angle: 90, invert: False},
right_shoulder_pan_joint: {id: 3, max_speed: 360, min_angle: -90, max_angle: 90, invert: False},
right_shoulder_lift_joint: {id: 4, max_speed: 360, min_angle: -90, max_angle: 90, invert: False, neutral: 512},
right_arm_roll_joint: {id: 5, max_speed: 360, min_angle: -90, max_angle: 90, invert: False},
right_elbow_joint: {id: 13, max_speed: 360, min_angle: -90, max_angle: 90, invert: True},
right_wrist_joint: {id: 6, max_speed: 360, min_angle: -90, max_angle: 90, invert: True},
left_shoulder_pan_joint: {id: 7, max_speed: 360, min_angle: -90, max_angle: 90, invert: False},
left_shoulder_lift_joint: {id: 8, max_speed: 360, min_angle: -90, max_angle: 90, invert: False, neutral: 512},
left_arm_roll_joint: {id: 9, max_speed: 360, min_angle: -90, max_angle: 90, invert: False},
left_elbow_joint: {id: 12, max_speed: 360, min_angle: -90, max_angle: 90, invert: True},
left_wrist_joint: {id: 10, max_speed: 360, min_angle: -90, max_angle: 90, invert: True},
torso_joint: {id: 11, max_speed: 360, min_angle: -120, max_angle: 120, invert: False}
}
(I have my ArbotiX set to 57600 baud.) And my launch file is:



<launch>
<node name="arbotix" pkg="arbotix_python" type="driver.py" output="screen">
<rosparam file="$(find pi_robot)/params/arbotix_params.yaml" command="load" />
</node>
<node name="arbotix_joint_controller" pkg="arbotix_controllers" type="joint_controller.py" output="screen">
<rosparam param="joints">[head_pan_joint, head_tilt_joint, right_shoulder_pan_joint, right_shoulder_lift_joint, right_arm_roll_joint, right_wrist_joint, left_shoulder_pan_joint, left_shoulder_lift_joint, left_arm_roll_joint, left_wrist_joint, torso_joint, left_elbow_joint, right_elbow_joint]</rosparam>
</node>
</launch>


Note that doing a "rostopic echo /joint_states" *does* show the servo positions updating when I move them by hand. So the reading part seems to be OK.

--patrick

lnxfergy
02-15-2011, 08:44 PM
Did you update your firmware? You'll need updated firmware for sync_write support (i'm going to add that to my first post.... total oversight to point out the need for firmware update).

-Fergs

Pi Robot
02-15-2011, 08:47 PM
Ha! I was just about to ask that. (Great minds forget alike. ;)) I tried it with use_sync: False but that didn't do it so I'm guessing sync write is now the only option? (Not that that isn't a good thing.)

I have go off to a $&#@# meeting but I'll do the firmware update tomorrow morning and report back.

--patrick

lnxfergy
02-15-2011, 08:50 PM
Ha! I was just about to ask that. (Great minds forget alike. ;)) I tried it with use_sync: False but that didn't do it so I'm guessing sync write is now the only option? (Not that that isn't a good thing.)

I have go off to a $&#@# meeting but I'll do the firmware update tomorrow morning and report back.

--patrick

It was actually an oversight that I forgot to add a parameter to turn off sync_write (although I can't think of a use case that would benefit from it).

-Fergs

Pi Robot
02-16-2011, 09:12 AM
OK, I'm back, trying to upgrade the firmware. The new ros.pde (0.41) + robocontroller (0010) compiles fine in the Arduino application (0019) but it's hanging when I try to upload. I have the baud rate in boards.txt set to 57600 because that is the last baud rate I was using. And I tried setting the Serial.begin() line in ros.pde to 57600 instead of 115200 but I don't think that affects this process right? I'm doing this using the FTDI breakout board and I have a green power light on the Arbotix. This breakout board was working fine to control the ArbotiX under 0.32 so I think it is OK. I must be missing a setting somewhere?

--patrick

lnxfergy
02-16-2011, 09:18 AM
OK, I'm back, trying to upgrade the firmware. The new ros.pde (0.41) + robocontroller (0010) compiles fine in the Arduino application (0019) but it's hanging when I try to upload. I have the baud rate in boards.txt set to 57600 because that is the last baud rate I was using. And I tried setting the Serial.begin() line in ros.pde to 57600 instead of 115200 but I don't think that affects this process right? I'm doing this using the FTDI breakout board and I have a green power light on the Arbotix. This breakout board was working fine to control the ArbotiX under 0.32 so I think it is OK. I must be missing a setting somewhere?

--patrick

The baud rate in boards.txt has to match the bootloader installed -- which is 38400 for the default bootloader shipped on the ArbotiX. Your own 57600/115200 is only at runtime (after the bootloader has exited and your app is running).

Luckily, this should be one of the last times you need to update the firmware as I think it's now pretty solid.

-Fergs

Pi Robot
02-16-2011, 09:40 AM
Thanks Fergs,

I'll give that a try as soon as I'm done cleaning up my Arduino folder which has become somewhat disorganized since the last time I did this...

--patrick

Pi Robot
02-16-2011, 10:31 AM
I downloaded the Arduino 0022 software and started from scratch. When trying to compile ros.pde, I get the following error:

ros.cpp: In function 'void loop()':
ros:544: error: 'setTXall' was not declared in this scope

I've got the arbotix and robocontroller libraries in the "libraries" subfolder of my "sketchbook" folder and I have the "arbotix" folder in the "hardware" subfolder of the "sketchbook" folder.

BTW, some of the arbotix and robocontroller library folders have the same name, and some, like "Servo" are the same as libraries in the "stock" Arduino library folder. Is there an order in which some of these should overwrite others? Or do they need to co-exist in separate folders?

--patrick

lnxfergy
02-16-2011, 11:02 AM
I downloaded the Arduino 0022 software and started from scratch. When trying to compile ros.pde, I get the following error:

ros.cpp: In function 'void loop()':
ros:544: error: 'setTXall' was not declared in this scope

I've got the arbotix and robocontroller libraries in the "libraries" subfolder of my "sketchbook" folder and I have the "arbotix" folder in the "hardware" subfolder of the "sketchbook" folder.

BTW, some of the arbotix and robocontroller library folders have the same name, and some, like "Servo" are the same as libraries in the "stock" Arduino library folder. Is there an order in which some of these should overwrite others? Or do they need to co-exist in separate folders?

--patrick

Ok, here we go -- I missed that by adding syncwrite support required that new setTXall() function. I've posted an ArbotiX 0014 (http://arbotix.googlecode.com/files/arbotix-0014.zip) release which includes the following updates:


The new and updated BioloidController lib.
The HServo library (used to be Servo in 0013 and Arduino < 0016, the new "Servo" library released by Arduino is based on an interrupt callback and while it supports 12 servos instead of 2, it has serious failures if your processor is nearly loaded up -- which is the case when polling/setting a large number of servos at a very high rate within our ros firmware).
And, for anyone using PyPose, it has the fixed Commander.py, which actually works correctly.

The other libraries are the same as the Arduino distribution, but tuned for the ArbotiX processor (mega644p). They will still work with 168/328 based Arduinos, but probably not the new Mega (as they predate the mega). We have been working on major overhauls to the core/libraries to catch up with the many changes that Arduino has implemented in the last several weeks -- I'll probably be posting another ArbotiX release next month.

-Fergs

Pi Robot
02-16-2011, 11:33 AM
Thanks Fergs! Compiling now works but I still get hung on upload. I went back to 0019 for the Ardunio software but same problem. I'm starting to suspect a hardware problem on my end but I have to take off now and I might not be able to try it again until tonight. Thanks for all your help so far!

--patrick

Pi Robot
02-16-2011, 11:35 AM
P.S. When the upload finally times out I get the error messages:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

--p

lnxfergy
02-16-2011, 11:46 AM
P.S. When the upload finally times out I get the error messages:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

--p

Is the reset jumper set?

-Fergs

Pi Robot
02-16-2011, 01:22 PM
I grabbed my ArbotiX board on the way out so I could continue testing. So this is now on a different machine and still no joy on the upload. The reset jumper is set--I tried it without just to be sure but it is back on now. When I initiate the upload, I see the Tx LED flash on the FTDI board but not the Rx LED.

BTW, I am using version 0019 of the Arduino software on this machine.

--patrick

lnxfergy
02-16-2011, 01:44 PM
I grabbed my ArbotiX board on the way out so I could continue testing. So this is now on a different machine and still no joy on the upload. The reset jumper is set--I tried it without just to be sure but it is back on now. When I initiate the upload, I see the Tx LED flash on the FTDI board but not the Rx LED.

BTW, I am using version 0019 of the Arduino software on this machine.

--patrick

2 Questions:

1) You haven't uploaded using an ISP before, have you? (if so, you'd have blown away the bootloader)
2) You aren't using arduino from apt-get, right?

-Fergs

Pi Robot
02-16-2011, 01:49 PM
No, I haven't used an ISP before. Also, I should have mentioned I'm doing this on Windows XP so I just unzip the Windows Arduino archive from the download site.

I also should have mentioned, that my ArbobtiX doesn't exactly match the layout in the photos included in the manual. For example, the reset jumper is not above the little orange capacitor, but is to the left of it and is labeled J1. Also there is a 3-pin header next to the FTDI header labeled FTDI at the top and VIN on the bottom. At the moment, there is a 2-pin jumper on the lower two pins, i.e. at the VIN end.

What's odd, is I didn't have these problems the last time I did a firmware upgrade using exactly the same setup.

--patrick

lnxfergy
02-16-2011, 01:56 PM
No, I haven't used an ISP before. Also, I should have mentioned I'm doing this on Windows XP so I just unzip the Windows Arduino archive from the download site.

I also should have mentioned, that my ArbobtX doesn't exactly match the layout in the photos included in the manual. For example, the reset jumper is not above the little orange capacitor, but is to the left of it and is labeled J1. Also there is a 3-pin header next to the FTDI header labeled FTDI at the top and VIN on the bottom. At the moment, there is a 2-pin jumper on the lower two pins, i.e. at the VIN end.

What's odd, is I didn't have these problems the last time I did a firmware upgrade using exactly the same setup.

--patrick

J1 is a different header (the serial one). The reset jumper is J2 (be sure J2 is enabled).

Also, when you press the reset button, the LED on the edge of the board should blink a few times -- if not, your bootloader might be frigged up. Same should happen right after TX blinks on the FTDI cable -- if not, the reset jumper is not set correctly.

-Fergs

Pi Robot
02-16-2011, 02:04 PM
Ah yes, that is J2, not J1. And I'm afraid to say that pressing the reset button does not flash any LEDs, either on the ArbotiX or the FTDI board. Am I SOL?

--p

lnxfergy
02-17-2011, 08:26 AM
Ah yes, that is J2, not J1. And I'm afraid to say that pressing the reset button does not flash any LEDs, either on the ArbotiX or the FTDI board. Am I SOL?

--p

Ok, just to confirm that we do have an issue -- it sounds like you've pulled the arbotix out of the bot to take with you -- is the power LED on? (i.e. have you switched the jumper near the FTDI header into the upper position so that 5V is coming from FTDI header rather than from VIN and the regulator?)

-Fergs

Pi Robot
02-17-2011, 08:43 AM
Yes, the green power LED on the ArbotiX is lit up and the jumper near the FTDI header is on the two pins near the VIN label. Unfortunately, I just realized I left the FTDI board at work so it'll be a couple of hours before I have access to it again.

--patrick

Pi Robot
02-17-2011, 11:28 AM
OK, I have the FTDI board hooked back up to my ArbotiX. I have a green power LED on the ArbotiX, the jumper near the FTDI header is on the two pins near the VIN label, and the reset jumper is on. Pressing the reset button at this point does not cause any blinking of any LEDs either on the ArbotiX or the FTDI board. Just in case it matters, I am powering the ArbotiX using a Robotis SMPS2Dynamixel adapter which in turn is connected to a CM5 power brick. I have measured the voltage at 12V.

--patrick

lnxfergy
02-17-2011, 12:16 PM
OK, I have the FTDI board hooked back up to my ArbotiX. I have a green power LED on the ArbotiX, the jumper near the FTDI header is on the two pins near the VIN label, and the reset jumper is on. Pressing the reset button at this point does not cause any blinking of any LEDs either on the ArbotiX or the FTDI board. Just in case it matters, I am powering the ArbotiX using a Robotis SMPS2Dynamixel adapter which in turn is connected to a CM5 power brick. I have measured the voltage at 12V.

--patrick

How about unplugging the SMPS2, and switching the jumper near the FTDI to be on FTDI not VIN (are you sure you have a 5V FTDI also?)

If that doesn't work, I imagine you do have a broken bootloader -- do you have an ISP around?

-Fergs

Pi Robot
02-17-2011, 01:48 PM
Just gave that a shot with the same result. Green power LED on ArbotiX lights up but no flashing LEDs when hitting the reset switch and the Arduino upload process times out with:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I don't have an ISP and I don't think either Frys or Radio Shack carries them which are the only two local electronics stores I can think of. If the bootloader is broken, would the ISP still work? If not, I can certainly order a new ArbotiX. I don't doubt that the cause of the problem was my fault at some point.

In the meantime, it would be great to try out your new 0.4.1 ROS code, but I don't think I can use it with the USB2Dynamixel anymore now that sync write is the only option. Is that correct?

--patrick

Peter_heim
02-17-2011, 02:15 PM
HI

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
I had a similar error when i loaded ver 0.4.1 i have a switch in place of the jumper that has to be up to load a program
thats when i got a error due to a distraction (kids) i left it down and the program loaded
when i launched the driver i had 2 steady lights the arm doesn't appear to work then i ran out of time
so many toys so little time

peter

lnxfergy
02-17-2011, 02:24 PM
I don't have an ISP and I don't think either Frys or Radio Shack carries them which are the only two local electronics stores I can think of. If the bootloader is broken, would the ISP still work?

ISP will allow you to upload a new bootloader.



In the meantime, it would be great to try out your new 0.4.1 ROS code, but I don't think I can use it with the USB2Dynamixel anymore now that sync write is the only option. Is that correct?

--patrick

The USB2Dyamixel will still work with sync_write! (it's sync_read which isn't a real AX instruction, but we have the use_sync parameter to turn that off as in the past).

-Fergs

Pi Robot
02-17-2011, 03:31 PM
ISP will allow you to upload a new bootloader.
-Fergs

Cool. I'll order an ISP then.



The USB2Dyamixel will still work with sync_write! (it's sync_read which isn't a real AX instruction, but we have the use_sync parameter to turn that off as in the past).


Excellent! I'm looking forward to getting to the trajectory stuff over the long weekend.

--patrick

lnxfergy
02-17-2011, 10:49 PM
Excellent! I'm looking forward to getting to the trajectory stuff over the long weekend.

I was working on getting ROS running our Chiaras today (they use a HUV board, similar to the USB2Dynamixel) -- I had no problem get 24 servos running at 20hz syncwrite -- although I was only able to get about 5hz reads.... I'll have to take a look at that (as it seems miserably low)

-Fergs

Peter_heim
02-18-2011, 04:31 AM
Hi Fergs
I had a bit of trouble running controllerGUI.pi the 's' is missing

import roslib; roslib.load_manifest('arbotix_controller')

to read a analog channel do i add this to the yaml file coping this results in a error?

analog_sensors: {rear ir: {pin: 1},

peter

lnxfergy
02-18-2011, 08:54 AM
I had a bit of trouble running controllerGUI.pi the 's' is missing

Good catch -- I've fixed it in both 0.4.1 and trunk. Note -- that controllerGUI (the one in arbotix_controllers) is the older style one that publishes cmd_joints -- there is a "newer" controllerGUI.py in the arbotix_python package that publishes directly to the <servo>/command topics.

Both controllerGUIs are actually getting completely replaced in the next release with a much better version that automatically loads the names of all your joints, creating a slider for each, and getting the limits from both URDF/YAML for specifying the sliders. It also has enable buttons for each servo and starts with all of them in the disabled position -- while disabled, the sliders will follow the output of the joint_states feedback (so that when you enable the servo, there will be no more head snapping to center!).


to read a analog channel do i add this to the yaml file coping this results in a error

That's not quite correct YAML (extra "," and a missing "}"). Try this:

analog_sensors: {rear ir: {pin: 1}}

-Fergs

Pi Robot
02-18-2011, 03:25 PM
Success! I have successfully moved my pan and tilt servos using controllerGUI.py in 0.4.1 (r280) and a USB2Dynamixel. Now on to the arm servos and the trajectory stuff. BTW, I'm really looking forward to having a GUI with sliders for all the joints!

--patrick

Pi Robot
02-18-2011, 04:39 PM
Hey Fergs,

I'm not seeing velocity control in 0.4.1 when publishing to the /cmd_joints topic and using the "classic" joint_controller.py node. For example, the two commands:

rostopic pub /cmd_joints sensor_msgs/JointState -- '{ header: {frame_id: head_pan_joint }, name: ['head_pan_joint', 'head_tilt_joint'], position: [1.0, 1.0], velocity: [0.1, 0.1], effort: [0.1, 0.1]}'

and

rostopic pub /cmd_joints sensor_msgs/JointState -- '{ header: {frame_id: head_pan_joint }, name: ['head_pan_joint', 'head_tilt_joint'], position: [1.0, 1.0], velocity: [1.0, 1.0], effort: [0.1, 0.1]}'

result in exactly the same movement speed even though the velocities are 0.1 rad/s in the first command and 1 rad/s in the second. I thought you added velocity control for /cmd_joints. No?

--patrick

lnxfergy
02-18-2011, 11:48 PM
I'm not seeing velocity control in 0.4.1 when publishing to the /cmd_joints topic and using the "classic" joint_controller.py node.

Patrick -- can you be sure you are definitely up to date with 0.4.1? It does work on my end -- but note that velocity control is new in 0.4.1 (was not in 0.4.0).

Note also that at this point, upgrading from 0.4.0 to 0.4.1 means checking out the new tag -- just doing svn up in the old 0.4.0 tagged directory doesn't work. Next release will likely be this week, and I intend to also create a /tags/arbotix/latest that will always point to the latest release (in this case, it will point to 0.4.2 this week), so that users can do an "svn up" to upgrade without such hassle.

-Fergs

Peter_heim
02-19-2011, 05:40 AM
Hi Fergs
I had time to play with release 0.4.1 with mixed results the aim was to try and move the servos
but nothing moved using the controllerGUI.py from arbotix_python controlling the dynamixel servos
i did a rostopic echo /joint_states it showed the 5 joints but no movement (3 joints were renamed to match those required ) i enabled the hobby servos and those joint then showed movement in the rostopic but not on the robot.
I'm using the joint state controller in the launch file

<node name="arm_joint_controller" pkg="arbotix_controllers" type="joint_controller.py">
<rosparam param="joints">[head_pan_joint, head_tilt_joint, right_shoulder_joint, right_shoulder_forward_joint, right_shoulder_roll_joint, right_elbow_joint, right_wrist_bracket_joint]</rosparam>
</node>
and the yaml file

port: /dev/ttyUSB0
baud: 38400
use_sync: true
read_rate: 5
write_rate: 10

analog_sensors: {rear_ir: {pin: 1}}




servos: {
right_wrist_bracket_joint: {id: 1},
head_tilt_joint: {id: 2},
#left_shoulder_joint: {id: 0, max_speed: 180, min_angle: -180, max_angle: 90},
#right_wrist_joint: {id: 1},

}

dynamixels: {
#head_pan_joint: {id: 7, max_speed: 180, min_angle: -145, max_angle: 145},
#head_tilt_joint: {id: 8, max_speed: 180, min_angle: -180, max_angle: 90, invert: true},
#right_shoulder_joint: {id: 2, max_speed: 180, min_angle: -145, max_angle: 145, invert: True},
#right_shoulder_forward_joint: {id: 3, max_speed: 180, min_angle: -145, max_angle: 145},
#right_shoulder_roll_joint: {id: 4, max_speed: 360, min_angle: -180, max_angle: 180},
#right_elbow_joint: {id: 5, max_speed: 360, min_angle: -145, max_angle: 145, invert: True},
#right_wrist_bracket_joint: {id: 1, max_speed: 360, invert: true},
right_shoulder_joint: {id: 2},
right_shoulder_forward_joint: {id: 3, max_speed: 180, min_angle: -145, max_angle: 145},
right_shoulder_roll_joint: {id: 4, max_speed: 360, min_angle: -180, max_angle: 180},
right_elbow_joint: {id: 5, max_speed: 360, min_angle: -145, max_angle: 145, invert: True},
head_pan_joint: {id: 1, max_speed: 360, invert: true}
}


I did a fresh checkout of 0.4.1 the firmware was the latest and arbotixcontroller was 014
the only thing i noticed different was after i started the arbotix the user light was steady not flashing as before

peter

Peter_heim
02-19-2011, 06:08 AM
Hi Fergs
After i reloaded the firmware i get the following error

Traceback (most recent call last):
File "/home/peter/ros/arbotix/arbotix_python/nodes/driver.py", line 459, in <module>
a = ArbotixROS()
File "/home/peter/ros/arbotix/arbotix_python/nodes/driver.py", line 315, in __init__
val = self.syncRead(synclist, P_PRESENT_VOLTAGE, 2)
File "/home/peter/ros/arbotix/arbotix_python/src/arbotix_python/arbotix.py", line 168, in syncRead
return self.execute(0xFE, AX_SYNC_READ, [start, length] + servos )
File "/home/peter/ros/arbotix/arbotix_python/src/arbotix_python/arbotix.py", line 120, in execute
self.ser.write(chr(0xFF)+chr(0xFF)+chr(index)+chr( length)+chr(ins))
File "/usr/lib/python2.6/dist-packages/serial/serialposix.py", line 339, in write
n = os.write(self.fd, d)
OSError: [Errno 5] Input/output error
[arbotix-2] process has died [pid 7326, exit code 1].
log files: /home/peter/.ros/log/e8584646-3c1e-11e0-bb10-0023cdfebf39/arbotix-2*.log

even after i remove all reference to servos from the yaml file and joint controllers in the launch file

peter

Pi Robot
02-19-2011, 07:51 AM
Patrick -- can you be sure you are definitely up to date with 0.4.1? It does work on my end -- but note that velocity control is new in 0.4.1 (was not in 0.4.0).

Note also that at this point, upgrading from 0.4.0 to 0.4.1 means checking out the new tag -- just doing svn up in the old 0.4.0 tagged directory doesn't work. Next release will likely be this week, and I intend to also create a /tags/arbotix/latest that will always point to the latest release (in this case, it will point to 0.4.2 this week), so that users can do an "svn up" to upgrade without such hassle.

-Fergs

Hey Fergs,

That was it! I had done an svn checkout on the trunk and just assumed that would be up to 0.4.1. So the velocity changes are now being recognized; however, the servo movements are "jerky" making a "rat-a-tat-tat" sound as if they were moving through a series of intermediate positions on the way to the target position.

--patrick

lnxfergy
02-19-2011, 11:03 AM
Hey Fergs,

That was it! I had done an svn checkout on the trunk and just assumed that would be up to 0.4.1. So the velocity changes are now being recognized; however, the servo movements are "jerky" making a "rat-a-tat-tat" sound as if they were moving through a series of intermediate positions on the way to the target position.

--patrick

Try raising your write_rate parameter -- it defaults to 10hz which looks a bit choppy but is certain to work even with poor setup. I've been running 20hz on maxwell:


write_rate: 20

-Fergs

Pi Robot
02-19-2011, 11:23 AM
Thanks Fergs--that seems to have helped. The head tilt servo movement is now quite smooth but the head pan servo is still a little jerky. Could be the servo...

--patrick

Pi Robot
02-19-2011, 12:36 PM
Hey Mike,

I confirmed that my head pan servo is OK by testing it under Windows using the ForestMoon Dynamixel Commander and again under Ubuntu using the UA ax12_controller package and the motion is smooth. So I went back to playing with rate parameters with the ArbotiX driver and now I find that I can get smooth motion over a range of rates, even with a write_rate of 10. So go figure. I do seem to notice an interaction between the "rate" parameter (used in joint_controller.py) and the "write_rate" parameter. I can't quite figure out how the ratio affects performance but if the "rate" parameter is set to anything less than the "write_rate" parameter, arbotix_python.py aborts with a ZeroDivisionError. This may not be a bug, just thought I'd report it. The actual error on the screen is:

[INFO] [WallTime: 1298140432.825731] Started ArbotiX connection on port /dev/ttyUSB0
Traceback (most recent call last):
File "/home/patrick/Eclipse/ros/arbotix/arbotix_python/nodes/driver.py", line 459, in <module>
a = ArbotixROS()
File "/home/patrick/Eclipse/ros/arbotix/arbotix_python/nodes/driver.py", line 370, in __init__
if f%self.throttle_w == 0:
ZeroDivisionError: integer division or modulo by zero
[arbotix-2] process has died [pid 29464, exit code 1].
log files: /home/patrick/.ros/log/86b804da-3c55-11e0-a21d-8c736e77238f/arbotix-2*.log


--patrick

Peter_heim
02-28-2011, 05:19 AM
Hi Fergs
I seams i was having 2 errors with release 0.4.1 on ros diamondback 1 was the fdti i was using had failed after installing a new one now i get read errors for the servo (i'm just using 1 on id2) whether i have reset enabled or disabled or use_sync set to false or true

When i compile the program in windows 7 the size is 10342 and when i compile it with ubuntu 10.4 it 10585
i can't upload in ubuntu for some reason but why would there be a size difference both sources are the same downloaded on the same day (17Feb)

peter

Pi Robot
02-28-2011, 08:09 PM
Hey Fergs,

So I have an ISP in hand but I'm having trouble burning the bootloader back onto the ArbotiX. I am using the Arudino IDE version 0019. I edited the boards.txt file for the ArbotiX so the key lines look like this:

# To use an ISP: uncomment the next line, comment out the protocol line
arbotix.upload.using=avrispmkii
#arbotix.upload.protocol=stk500

Then in the Arduino IDE I select Tools->Burn Bootloader->w/AVRISP mkII(arbotix)

and the error I get is:

avrdude: ser_open(): can't open device "\\.\COM49": The system cannot find the file specified.

I have the ArbotiX powered on (green LED on) and the ISP cable connected. The ISP board I have is from Sparkfun:

http://www.sparkfun.com/products/9825

and I installed the Windows driver from that page. I am using Windows XP and the driver installation seemed to have gone smoothly.

Any thoughts? One slightly odd observation: if I hit the reset button on the ArbotiX while it is connected to the ISP, the LEDs on the ISP board blink and a line flashes across my monitor(!). Not sure if the flash across the monitor means anything...

--patrick

lnxfergy
02-28-2011, 08:17 PM
Patrick, looks like that programmer is based on USBTiny, which is different from the avrispmkii.

See http://code.google.com/p/arbotix/wiki/GettingSetup#Programmer_Setup for how to run the USBtiny.

-Fergs

lnxfergy
02-28-2011, 08:19 PM
Actually, you should be able to do Tools | Burn Bootloader | w/ USBtiny to put a bootloader onto the ArbotiX, and then go back to uploading using the FTDI with the older boards.txt

-Fergs

Pi Robot
02-28-2011, 08:22 PM
Thanks Fergs. I gave that a try and now the error I get is:

avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

--patrick

tician
02-28-2011, 10:18 PM
Have you verified the orientation of the connector on the ISP? If the ISP connector is flipped or rotated, the reset button would be pulling the GND or VCC line, respectively, of the ISP to the Arbotix's ground which might be enough to cause the LED flashing (ala 'magic (http://www.jargon.net/jargonfile/a/AStoryAboutMagic.html)') and definitely explain the error AVRdude is spitting out. If it isn't a wiring problem, it may be a permissions problem, except you are using windows... Nevermind.

Pi Robot
03-01-2011, 09:34 AM
Thanks tician. The ArbotiX does not have markings or a keyed socket to indicate correct orientation. If I plug the ISP connector on in the direction that seems natural, I get the error I reported. If I plug it in the other way, the ArbotiX green power LED lights up (even without power applied to the ArbotiX power terminals) and I get the same error.

--patrick

lnxfergy
03-01-2011, 10:48 AM
Thanks tician. The ArbotiX does not have markings or a keyed socket to indicate correct orientation. If I plug the ISP connector on in the direction that seems natural, I get the error I reported. If I plug it in the other way, the ArbotiX green power LED lights up (even without power applied to the ArbotiX power terminals) and I get the same error.

--patrick

The ISP cable should hang off the side of the board -- and the board needs to be powered for the ISP to work.

-Fergs

tician
03-01-2011, 11:13 AM
A side note I should have mentioned earlier and that may not have been included in the instructions/manual you received: if the target is self-powered, there should be a switch on the ISP to disconnect the VCC pin of the ISP connector from the 5V-USB. It is generally not wise to apply two different sources to the target (even if they are both 5V nominal, there will be some difference between the two).

The USBtinyISP can power its target with up to 500mA at 5V from USB. So if you have connected the ISP (with the "TARGET-PWR" switch set to connect the connector's VCC pin to 5V-USB) and unplugged the arbotix from external power and the power-on LED of the arbotix is still lit (from the schematic the ISP header's VCC is connected directly to the arbotix 5V signal which directly powers the LED), then you have the ISP connected correctly. If it has been verified to function while powered by the ISP and you are still getting the initialization error, it MAY be that one or more of the pins on the cable were wired wrong. If you have some hook-up wire and wire clips (or better yet, some of the sparkfun male-to-female breadboard jumper cables), then you can try using the ten-pin connector. Just follow the schematic from the sparfun product site to wire the appropriate signals together. A couple very important reminders: 1) pin 1 is the pin on the connector with the arrow (and should also have the red wire) and 2) that the pins on the connectors count back and forth/side to side, and not along the perimeter like microcontrollers.

Absolutely double check this with the schematic:
MOSI is pin #1 of the 10-pin and pin #4 of the 6-pin
RST is pin #5 of the 10-pin and pin #5 of the 6-pin
SCK is pin #7 of the 10-pin and pin #3 of the 6-pin
MISO is pin #9 of the 10-pin and pin #1 of the 6-pin
GND is pins #4, #6, #8, and #10 of the 10-pin and pin #6 of the 6-pin (only one should need to be connected as they are all connected to GND on the ISP)
VCC is pin #2 of the 10-pin and pin #2 of the 6-pin

Pi Robot
03-01-2011, 06:56 PM
Thanks again tician. When I slide the ISP pwr switch to "Power Target" with the ArbotiX's power source disconnected, I have to connect the 6-pin connector in the reverse sense that Fergs said (and the way I considered "natural", with the cable hanging off the board) to get the ArbotiX power LED to light up. In any case, I get the same error from the Bootloader no matter which way I connect the cable, slide the ISP pwr switch, and /or power the ArbotiX. So perhaps it is bad wiring. It is a funky cable with a 10-pin connector and a second cross-wired 6-pin connector which is the one I have been using. The cable looks just like the following image:

http://dlnmh9ip6v2uc.cloudfront.net/images/products/09825-05.jpg

I don't have the setup to test out different connections, so I may just wait for a second ArbotiX to arrive...

--patrick

tician
03-01-2011, 07:26 PM
Yeah. As soon as I saw the picture of that cable on the sparkfun site, my brain had to shut down for a bit so it wouldn't explode when 'WTF?!' popped into my head. That cable reminds me of my horrible attempt at a similar 'fix' a few years ago. I have a 2+ year old USBtinyISP direct from Adafruit and it has served me pretty well for the inexpensive little kit that it is (it has both the 6-pin and 10-pin connectors but with two different/independent headers and cables, so no cheapo Frankenstein's monster). But I digress. Sorry I couldn't have been more help, and I wish you the best of luck and skill in getting your arbotix working again.

lnxfergy
03-01-2011, 07:43 PM
Looking at that cable (I didn't realize it had such a messed up cable, the Linux/mac woes scared me away from ever trying that ISP), it would appear that the 'key' on the bottom side of the connector should be pointed in towards the processor (after following where pin 1 of the ISP would be) -- and so the cable would actually hang across the board rather than off the side.

-Fergs

Pi Robot
03-01-2011, 07:48 PM
Thanks again tician and Fergs--this has all been very helpful as I'm rather pathetically ignorant when it comes to the Arduino world. So Fergs, do you think the "Power Target" setting on this ISP board should be enough for burning the ArbotiX? Or should I leave the ISP power off and power the ArbotiX the normal way?

--patrick

lnxfergy
03-01-2011, 08:03 PM
Thanks again tician and Fergs--this has all been very helpful as I'm rather pathetically ignorant when it comes to the Arduino world. So Fergs, do you think the "Power Target" setting on this ISP board should be enough for burning the ArbotiX? Or should I leave the ISP power off and power the ArbotiX the normal way?

--patrick

You should be able to power it from the ISP -- although I have to admit I've never used an ISP with such a feature.

-Fergs

tician
03-01-2011, 09:53 PM
It's the same as if you were powering the board using the FTDI dongle with up to 500mA at 5V over USB. It is very nice when doing a quick test and/or prototyping on a bread board and you can't be bothered to wire up a power supply. Such as powering and programming an ATmega168 to echo any UART input at 1 Mbps, then powering and testing the same ATmega168 with an FTDI breakout board. No external power supply needed, just unplugged the RST and VCC pins of the USBtinyISP when I finished programming and then plugged a mini-USB cable into the FTDI to switch over to its power and comms. Want to use the target's power supply instead, just pull off a jumper or flip a switch and the target will power the quad buffer ensuring proper signal levels.

Just to note, I have used the Adafruit USBtinyISP (not the clone) exclusively on linux with the only problem being permissions related (the fix to which is posted on her project site).

Also, Sorry for thread jacking with the ISPs and all.

Pi Robot
03-02-2011, 09:03 AM
Well, it just occurred to me that I had an Arduino Uno still sitting in the shrink wrap so I pulled it out and hooked it up to the ISP in "Power Target" mode (no additional power to the Arduino) and guess what? Same avrdude error as with the ArbotiX. So I'm beginning to suspect either wiring or a problem with the driver under Windows. Perhaps I can try it on Linux instead...

--patrick

lnxfergy
03-20-2011, 05:15 PM
I've just released 0.4.2. There are no firmware changes for this release -- so no need to update the firmware on your ArbotiX.

Highlights of this release:


NEW: completely rewritten controllerGUI -- automatically reads limits/names of servos from URDF or the arbotix YAML specification (yaml overrides URDF). Also subscribes to joint_states to avoid "snapping" to position on startup.
NEW: use_sync parameter is now sync_read, added sync_write parameter to disable sync_writes.
NEW: max_sonar
NEW: added "value" parameter to SetupChannels service and analog/digital from yaml. This allows you to set pullup resistors on inputs, or set a default value for digital outputs.
FIXED: Patches to make arbotix_python work with cturtle (note: arbotix_sensors will not work, as it requires the range message from the new sensor_msgs)
FIXED: analog/digital from YAML specs did not launch before
FIXED: velocity calculation for dynamixels now working!

Starting with this release, I've also created a "latest" tag, so you can install using:

svn co http://vanadium-ros-pkg.googlecode.com/svn/tags/arbotix/latest arbotixThis will make updating to a new release easier in the future, as latest will always contain the latest release.

As usual, let me know if you have any issues. This release has been extensively tested on Maxwell -- who completed a 48 hour uptime test this last week. The next release will focus on adding a few more controllers, stable NUKE support, and recovering from USB bus failures.

-Fergs

Pi Robot
04-24-2011, 10:51 PM
Hey Fergs,

I'm not getting any position/velocity data from my AX-12s when using a USB2Dynamixel and the latest trunk revision (303) of the Arbotix stack. I can move the servos fine with controllerGUI.py but I'm getting only 0's on the /joint_states topic for both position and velocity. At the moment I'm testing with just two servos and my params file looks like this:


port: /dev/usb2dynamixel
baud: 1000000
rate: 20
read_rate: 20
write_rate: 20
use_sync: True

dynamixels: {
head_pan_joint: {id: 1, max_speed: 360, min_angle: -145, max_angle: 145, invert: False},
head_tilt_joint: {id: 2, max_speed: 360, min_angle: -60, max_angle: 90, invert: True}
}
Any thoughts?

--patrick

lnxfergy
04-25-2011, 09:31 AM
Patrick,

You have to set use_sync to false (since the USB2Dynamixel has no sync_read instruction). You'll also probably have to drop your read_rate, since the USB framing makes reading each servo quite slow.

-Fergs

Pi Robot
04-26-2011, 08:46 AM
Hey Fergs,

I tried things with use_sync set to False and I get the same result: I can move the servos, but I only get back 0's on the /joint_states topic. Next I lowered all the rates as follows:


port: /dev/usb2dynamixel
baud: 1000000
rate: 5
read_rate: 5
write_rate: 5
use_sync: False

dynamixels: {
head_pan_joint: {id: 1, max_speed: 360, min_angle: -145, max_angle: 145, invert: False},
head_tilt_joint: {id: 2, max_speed: 360, min_angle: -60, max_angle: 90, invert: False}
}and still the same result.

--patrick

lnxfergy
05-03-2011, 12:18 AM
Patrick,

We also have to rename use_sync to sync_read! I missed that this feature made it into 0.4.2 (I just added it to the wiki). The reasoning behind this was that we now have a ~sync_write parameter as well (since sync_write is now used by default, and you might have a device on your bus that can't handle sync_writes).

-Fergs

Pi Robot
05-03-2011, 12:38 AM
Thanks Fergs--this fixed my problem with the USB2Dynamixel. I'll test more tomorrow but so far it's looking good!

--patrick

Pi Robot
05-16-2011, 09:25 AM
I've just released 0.4.2. There are no firmware changes for this release -- so no need to update the firmware on your ArbotiX.

Hey Fergs,

I was wondering if you have any plans to add servo velocity control to the ROS ArbotiX driver. As it stands, it seems that servo motions run at maximum speed unless you are using a ROS action to control them(?). I noticed that the UA ax12_controller_core package has a set_speed service for this purpose. The other item for my wish list would be the ability to set a torque limit on the fly for each servo. This would be handy for compliant motions and might help prevent servo burnout. The ax12_controller_core package has set_torque_limit service for this.

I'd be happy to add these myself and send back a patch if you think it is straightforward enough and can point me to the appropriate place in driver.py to add them.

Thanks!
patrick

lnxfergy
05-16-2011, 03:47 PM
There are a number of questions here, see replies below:


I was wondering if you have any plans to add servo velocity control to the ROS ArbotiX driver. As it stands, it seems that servo motions run at maximum speed unless you are using a ROS action to control them(?).

There are two levels of speed control. If you set a "max_speed" in your YAML file, the core (driver.py) will limit the max speed of the servo to this. At the next higher level of control, the trajectory controller can take in a desired speed, and will move the servo at that speed (if the desired speed is higher than max_speed, the internal controller slows it down).


I noticed that the UA ax12_controller_core package has a set_speed service for this purpose.

I assume this is setting the speed on the servo, right? The problem I find with setting the speed on the servo is that you are limiting the voltage the servo runs at -- causing a huge decrease in torque and an increase in heat. The arbotix approach is to instead step the servos at 30-50hz, which isn't too noticeable (future work should make it invisible, especially when using servos with 12-bit resolution such as the EX-106 or new MX servos).


The other item for my wish list would be the ability to set a torque limit on the fly for each servo. This would be handy for compliant motions and might help prevent servo burnout. The ax12_controller_core package has set_torque_limit service for this.

One thing I've been thinking about is adding a new service for setting/querying the state of the servo -- this would allow access to any register (rather than having 20-something services per servo). Thoughts?

-Fergs

Pi Robot
05-16-2011, 06:33 PM
Thanks Fergs,

The combination of max_speed and trajectory control should work nicely--I had forgotten the fact that I haven't tried the trajectory controller yet! And I had no idea that changing the speed on a Dynamixel by setting its "Moving Speed" works by reducing voltage and torque. So kudos for making the smarter stepping technique work.

And yeah, it would be great to have access to all the motor states with a single service, though the two I would use the most (probably 95% of the time) would be set_torque_limit and torque_enable (true/false)--I realize you already have the relax service for disabling.

--patrick

Pi Robot
05-16-2011, 07:04 PM
Just an update to my previous post: I was trying out the max_speed parameter when using a USB2Dynamixel (haven't tried it with the ArbotiX yet). I set it fairly low (25) to make slow movements on two AX-12 servos (head pan and tilt). With the the write_rate set to 10 (the default) and sync_write set to True, the movement takes on a "rat-a-tat-tat" form as it jumps between intermediate points. But raising the write_rate to 50 smooths it out nicely. (In both cases I have the rate parameter set to 100.)

Just an FYI, more for other users.

--patrick

lnxfergy
05-16-2011, 08:35 PM
Just an update to my previous post: I was trying out the max_speed parameter when using a USB2Dynamixel (haven't tried it with the ArbotiX yet). I set it fairly low (25) to make slow movements on two AX-12 servos (head pan and tilt). With the the write_rate set to 10 (the default) and sync_write set to True, the movement takes on a "rat-a-tat-tat" form as it jumps between intermediate points. But raising the write_rate to 50 smooths it out nicely. (In both cases I have the rate parameter set to 100.)

Just an FYI, more for other users.

--patrick

Yup, 30-50 hz for a write rate will smooth out the interpolation.

-Fergs

lnxfergy
05-16-2011, 08:41 PM
Thanks Fergs,

The combination of max_speed and trajectory control should work nicely--I had forgotten the fact that I haven't tried the trajectory controller yet! And I had no idea that changing the speed on a Dynamixel by setting its "Moving Speed" works by reducing voltage and torque. So kudos for making the smarter stepping technique work.

And yeah, it would be great to have access to all the motor states with a single service, though the two I would use the most (probably 95% of the time) would be set_torque_limit and torque_enable (true/false)--I realize you already have the relax service for disabling.

--patrick

Well, access to things like temperature cutoff thresholds, LEDs, alarm levels, and compliance settings (and PID settings on the new MX-28) could be useful...

-Fergs

Pi Robot
05-16-2011, 09:54 PM
Definitely!

Pi Robot
05-16-2011, 09:58 PM
The combination of max_speed and trajectory control should work nicely--I had forgotten the fact that I haven't tried the trajectory controller yet!

So I just tried out the ArbotiX trajectory controller for the first time using just my pan/tilt servos and it works beautifully! One question I have about ROS trajectories. Right now I am just specifying a single target position so the trajectory controller does the interpolation between my starting joint positions and the target positions. My question is: is there some magic incantation of the trajectory controller that will make the servos reach their target positions at the same time? Or do I have to create a specific trajectory with intermediate positions for that to happen?

--patrick

Pi Robot
05-17-2011, 09:22 AM
OK, I think I answered my own question above: the trajectory controller will just faithfully carry out the trajectory you feed it (imagine!) but how you shape the trajectory is up to you (e.g. a planner of some sort or simply listing a series of trajectory position/velocity points). Is that right?

In the meantime, I was wondering: does it make sense to tuck the various controllers such as /head_pan_joint/command under an /arbotix namespace by default? E.g. /arbotix/head_pan_joint/command? I ask because I see that the parameters end up under /arbotix but the controllers don't. I don't know if there is a preferred way to do this? If everything is under /arbotix, I can imagine it might be easier to enumerate controllers and such within a node. What do you think?

--patrick

lnxfergy
05-17-2011, 07:46 PM
So I just tried out the ArbotiX trajectory controller for the first time using just my pan/tilt servos and it works beautifully! One question I have about ROS trajectories. Right now I am just specifying a single target position so the trajectory controller does the interpolation between my starting joint positions and the target positions. My question is: is there some magic incantation of the trajectory controller that will make the servos reach their target positions at the same time? Or do I have to create a specific trajectory with intermediate positions for that to happen?


OK, I think I answered my own question above: the trajectory controller will just faithfully carry out the trajectory you feed it (imagine!) but how you shape the trajectory is up to you (e.g. a planner of some sort or simply listing a series of trajectory position/velocity points). Is that right?

So, I think I've just realized that I totally botched the implementation of the trajectory controller from a standpoint of making it ROS-like. I'm rewriting it right now, but it will take a bit of testing.

Looking into how trajectory messages are generally used, the position/velocity/acceleration should be the instantaneous values at the trajectory points. So, for a simple trajectory controller based only on positions, it should interpolate from the current position to the trajectory point in the correct amount of time, regardless of the velocities. A more advanced one would attempt to also be moving at the desired velocity when passing through the trajectory point.

This probably explains a number of problems I had interfacing with other source of trajectory messages.


In the meantime, I was wondering: does it make sense to tuck the various controllers such as /head_pan_joint/command under an /arbotix namespace by default? E.g. /arbotix/head_pan_joint/command? I ask because I see that the parameters end up under /arbotix but the controllers don't. I don't know if there is a preferred way to do this? If everything is under /arbotix, I can imagine it might be easier to enumerate controllers and such within a node. What do you think?

The controllers themselves are separate nodes... so I don't think they should be pushed into the /arbotix namespace by default.

-Fergs

Pi Robot
05-18-2011, 08:10 AM
Looking into how trajectory messages are generally used, the position/velocity/acceleration should be the instantaneous values at the trajectory points. So, for a simple trajectory controller based only on positions, it should interpolate from the current position to the trajectory point in the correct amount of time, regardless of the velocities. A more advanced one would attempt to also be moving at the desired velocity when passing through the trajectory point.

This probably explains a number of problems I had interfacing with other source of trajectory messages.


Cool--glad you caught this as I would have been clueless!



The controllers themselves are separate nodes... so I don't think they should be pushed into the /arbotix namespace by default.
-Fergs

Good point--I keep thinking in terms of a single controller.

--patrick

Pi Robot
05-19-2011, 09:50 AM
Hey Fergs,

I think I have found a bug in driver.py. I am using revision 315 since when I tried the latest from the trunk I get stuck on "Waiting for response..." messages at launch time. So back to r315: the bug is that when I first launch driver.py, then publish an angle of 0.0 to one of the servo controllers, the servo does not move, even when it is not already at position 0.0 radians. Any other value works, such as 0.01. After publishing any other value, then publishing 0.0 works as expected. So there is something special about publishing 0.0 as the very first target position after launching the driver. (I actually do this to center the servos right after launch.)

--patrick

lnxfergy
05-19-2011, 10:36 AM
I think I have found a bug in driver.py. I am using revision 315 since when I tried the latest from the trunk I get stuck on "Waiting for response..." messages at launch time.

Are you connected to a real arbotix? If not, I just added a check for when we need to wait (this wait for response is needed whenever we have to upload base PID parameters or setup analog/digital IO on startup). Try using r322 and see if it fixes the waiting problem for you.


So back to r315: the bug is that when I first launch driver.py, then publish an angle of 0.0 to one of the servo controllers, the servo does not move, even when it is not already at position 0.0 radians. Any other value works, such as 0.01. After publishing any other value, then publishing 0.0 works as expected. So there is something special about publishing 0.0 as the very first target position after launching the driver. (I actually do this to center the servos right after launch.)

Yep, that was a bug in the command callback. I've fixed it in r323.

-Fergs

Pi Robot
05-19-2011, 11:31 AM
Thanks Fergs--that fixed both problems. And yeah, I should have mentioned I was getting the "Waiting for response..." messages with a USB2Dynamixel. But works great now with r323.

--patrick

jronald
05-26-2011, 07:15 PM
Patrick,

I really liked your ROS for the Rest of Us presentation. I was going purchase a Serializer until reading through the forums. Now I don't know if I should purchase a ArbotiX, Serializer or iRobot Create. I do already have a robot platform (VEX Chassis, gear motors, motor controller, BeagleBoard XM). Have you gotten your ArbotiX working again following the firmware upgrade?

I also see that you are using the VEX wheels on Pi and I was wondering how you mounted them to the gear shaft?

Regards,
- Jim Ronald

lnxfergy
05-26-2011, 11:46 PM
I'm rewriting it right now, but it will take a bit of testing.

New trajectory controller is released into r343. It's only looking at position values right now, a more advanced position+velocity controller is in the works.

-Fergs

Pi Robot
05-27-2011, 11:01 AM
Patrick,

I really liked your ROS for the Rest of Us presentation. I was going purchase a Serializer until reading through the forums. Now I don't know if I should purchase a ArbotiX, Serializer or iRobot Create. I do already have a robot platform (VEX Chassis, gear motors, motor controller, BeagleBoard XM). Have you gotten your ArbotiX working again following the firmware upgrade?

I also see that you are using the VEX wheels on Pi and I was wondering how you mounted them to the gear shaft?

Regards,
- Jim Ronald

Hi Jim,

I'll invite Fergs to move this discussion to a new thread if he sees fit, but in the meantime, I think an iRobot Create + ArbotiX would make a nice combination depending on your plans. If you use the Create, you can take advantage of the Turtlebot (http://www.ros.org/wiki/Robots/TurtleBot)stack from Willow Garage. And if you use an ArbotiX, you can add a pan/tilt head or arms using Dynamixels. (Not to mention that Fergs has probably the best tech support record on the planet. :-) The ArbotiX also has its own PID controller like the Serializer as well as analog/digital sensor capabilities. While the Serializer can control hobby servos (PWM), I think the Dynamixels are a better fit with ROS since you get all the nice feedback for position, velocity, torque, temperature, etc.

As for the Vex wheels on Pi Robot, I mounted a pair of 6mm Lynx motion wheel hubs (http://www.lynxmotion.com/p-114-universal-hub-6mm-pair.aspx) onto two small Vex gears and mounted the assembly onto these Gearhead motors (http://www.roboticsconnection.com/p-51-dc-gearhead-robot-motor.aspx). I then use the standard square axles and a larger gear cog on the Vex wheels so the motors drive the smaller gear which drive the wheels via the larger gear.

--patrick

Pi Robot
05-27-2011, 11:36 AM
Have you gotten your ArbotiX working again following the firmware upgrade?


Oops--forgot to answer this question. Yes, Fergs helped me out when we met at Robogames last month.

--patrick

jronald
05-27-2011, 06:29 PM
Patrick,

Thanks for the feed back. I think that I may go the Create (DIY) TurtleBot type bot route in order to leverage the TurtleBot tutorials, packages and such. How well does the Create move on short carpet?

Feel free to move these posts to a different thread.

Pi Robot
05-27-2011, 08:22 PM
New trajectory controller is released into r343. It's only looking at position values right now, a more advanced position+velocity controller is in the works.

-Fergs

Hey Fergs,

Just so I'm sure what this means--I am currently using the previous revision of your trajectory controller to do head tracking based on pan and tilt speeds proportional to the displacement of the target. So I set the trajectory velocities accordingly. I assume this won't work (yet) in revision 343?

Also, I may have found a small bug in the previous revision when setting velocities to 0. I think this may be causing the Dynamixels to move at full speed (because of the special nature of that value to the Dynamixel itself.) My workaround is to use a small value like 0.0001 instead of exactly 0.

--patrick

Pi Robot
05-27-2011, 08:24 PM
Patrick,

Thanks for the feed back. I think that I may go the Create (DIY) TurtleBot type bot route in order to leverage the TurtleBot tutorials, packages and such. How well does the Create move on short carpet?

Feel free to move these posts to a different thread.

Hi Jim,

Yeah, I too have a DIY Turtlebot and I will start working through the TB stack one of these days. We have a short carpet and it moves very well. (It is, after all, the cousin of a vacuum cleaner :-).

--patrick

lnxfergy
05-27-2011, 09:46 PM
Hey Fergs,

Just so I'm sure what this means--I am currently using the previous revision of your trajectory controller to do head tracking based on pan and tilt speeds proportional to the displacement of the target. So I set the trajectory velocities accordingly. I assume this won't work (yet) in revision 343?

Also, I may have found a small bug in the previous revision when setting velocities to 0. I think this may be causing the Dynamixels to move at full speed (because of the special nature of that value to the Dynamixel itself.) My workaround is to use a small value like 0.0001 instead of exactly 0.

--patrick

The old version moved at full speed when set to velocity 0.. yep. The new version will move to the positions based on the time you set in each JointTrajectoryPoint -- so all servos will end at the same time automatically! Just make sure you set the JointTrajectoryPoint time_from_start, and you'll be all set.

-Fergs

jronald
05-27-2011, 09:59 PM
Yeah, I also found another Turtlebot that looks like a mini maxwell ;-) Those Creates will soon be flying off the shelves if they are not already. I better get mind ordered.

Pi Robot
05-27-2011, 10:04 PM
Cool. Though I might have to wait until you have separate velocity control for each servo. The way I am doing object tracking right now is that I set the speeds of the pan and tilt servos independently and proportional to the x or y displacement of the target from the enter of the FOV. Then I set the target positions to the max or min position of the relevant servo. This results in smooth tracking at speeds relevant to the two different displacement values. When a displacement approaches zero, so does the servo speed, so the servo stops moving.

--patrick

zhayantian
04-27-2014, 08:13 PM
Hi fergs,

I would like to consult that, if I just want to move gripper, should I send a goal to the gripper controller? The goal is float64, of course. If I can, the server definition in gripper_controller.py is "self.server = actionlib.SimpleActionServer("~gripper_action",GripperCommandAction,execute_cb=self.actionCb,aut o_start=false)", and I don't know why you add "~". This bother me so much when coding the client(I cannot define the client by ac("~gripper_action",true)), which would bring nodehandle problem. And if I delete the "~" in gripper_controller.py, when running the client it just waiting. Please give me suggestions, thanks so much!

-Yantian

zhayantian
04-27-2014, 08:23 PM
Hi fergs,

I would like to consult that, if I just want to move gripper, should I send a goal to the gripper controller? The goal is float64, of course. If I can, the server definition in gripper_controller.py is "self.server = actionlib.SimpleActionServer("~gripper_action",GripperCommandAction,execute_cb=self.actionCb,aut o_start=false)", and I don't know why you add "~". This bother me so much when coding the client(I cannot define the client by ac("~gripper_action",true)), which would bring nodehandle problem. And if I delete the "~" in gripper_controller.py, when running the client it just waiting. Please give me suggestions, thanks so much!

-Yantian

lnxfergy
05-04-2014, 01:57 PM
The ~ puts the topic in the local namespace of the node. Thus, if the gripper controller runs with the name "gripper_controller" the full action name becomes "gripper_controller/gripper_action" -- and that is the name your client should use.

-Fergs