Log in Page Discussion History Go to the site toolbox

ROS WAM Tutorial

From WikIRI

Contents

WAM Tutorial

This page covers the instructions needed to start working with a WAM in a ROS enviroment, mainly addressed to IRI students.

Starting point is: the wam is completely closed and powerless and we've just entered a session on the computer next to the WAM.

Installation

This tutorial assumes that you are working in a machine with low level WAM drivers and ROS installed. If you are working at IRI and feel like you need to install any of these, please speak with the laboratory staff first.

In your user account, please install IRI-ROS stacks.

Start the WAM's computer server

You'll have to turn on the WAM's power supply. If you have the screen connected to the WAM computer, you can see the start up process by switching the screen display to analogic in the right screen controls. Sometimes it fails to boot and you'll have to reboot. To know if everything went alright:

  • You should see the ubuntu login prompt if you have a screen connected to the WAM's VGA or be able to login by ssh remotely (ssh robot@wam)
  • if you press shift+idle the L should disappear and become a 0 (release bot E-Stops if you see an E in the display)

If you don't have access to a screen, and you get a Connection timed out or other message when you ssh robot@wam, try pressing enter on the WAM's keyboard, if it is connected to the WAM's internal PC and retry.

If the first doesn't happen and you get a black screen with a flickering underscore, shut down the power supply and restart (Requires VGA screen)

If the first doesn't happen and you get the grub entry menu, press e, remove the quiet option on the third line and the quiet splash on the last line and press ctrl+x to boot (Requires VGA screen)

If the first happens, but not the second, log in, and shutdown the PC with sudo shutdown -h now. After a while, shutdown the power supply and restart.

Ok so, you got the login promt, switch the screen to digital and log in remotely to the WAM PC with

ssh robot@wam1

or

ssh robot@ip_address 

you can recover the command from the historical with ctrl+R and typing insmod

If you want to use the hand as well, check the Barrett Hand wikiri page, but you'll have to supply current to the serial port with

sudo parashell 0x378 5

Now, let's start the wam server

cd btclient/src/WAMinterfacelib/socketwamif/
./wam_server

You will see the text

[WD] Awaiting connection event: Connection server for WAM_new_connection_event

Now you can run the client in your PC

Make sure paths are correct before next step. Launch ROS.

roscore

If the wam_node hasn't been build yet, you'l have to build it with:

rosmake iri_wam_wrapper iri_wam_wrapper

Now, since we have the Server running with ./wam_server, we can launch the ros node client

roslaunch iri_wam_wrapper iri_wam_21.launch

You'll be required to idle it pressing shift+idle on the pendant, then enter on the wam_node terminal, wait until all lights are green and then shift+activate and finally enter again on the wam_node terminal. The wam will go to the default position and enable gravity after an arbitrary wait.

Additionally, if you wish, you can launch its associate nodes wam_fk, wam_ik if required (wam_ik has third-party dependencies Wam ik). Check WAMexampleCommands.txt at the root of the ros wam stack for examples that run them separatelly, since you'll have to rename the topic's names accordingly (there's an example at ROS WAM page). You'll need to build them with rosmake.

Now the robot is waiting commands, you can follow the [Command-line_robot_control_(WAM)] instructions for command line control, complementing it with rviz rosrun rviz rviz if you want to see the joints' frames.

Moreover, Caution, the arm will move, if you wish, you can run an example application running wam_tutorial launchfile with

roslaunch wam_tutorial wamtuto.launch

complementing it with rviz rosrun rviz rviz if you want to see the joints' frames.

Wam tutorial example application

There's an example application that uses most of the supported functionality called wam_tutorial, it comes with a launch file that will launch the wam_fk, wam_ik and wam_tutorial nodes with the appropiate topic renaming. You have to run roscore and wam_node (client & server) in a separate terminal before launching. You can additionally run rviz with rosrun rviz rviz and after you've set the reference frame to /wambase you'll see both the targeted moves as well as the wam's joint states.

Shutting down

When you're done, press control+c on the ros iri_wam_wrapper node terminal. The shutdown message will be sent to the WAM and the closing process will start. Wait until the WAM reaches home before doing anything, then, wait until you see the following message in the server terminal:

[Main thread] shutting down, idle the robot and press enter.

Idle the WAM, and afterwards, press enter in both terminals.

If you wan to turn the whole robot and its computer off, shutdown the system with

sudo shutdown -h now

Notes

If something happens to the client and disconnects, the wam_server will detect it and destroy client information and wait for another client. If the WAM was already activated, do not shift+idle the WAM, or the internal wam state will be wrong, just press enter two times. If it wasn't activated, follow as usual.

Some preprocessor defines allow to execute differents parts of the program, check in the wamManualControl.cpp the USEWAM and IMGCAM defines and comment or uncomment them. You can comment them and use flags when building the project.

Troubleshooting

  • When I run the server or the examples I get
Xenomai: binding failed: Operation not permitted.

You need root privileges to run the Real-Time threads, so use sudo!

  • Something went wrong, can I have some debugging information?

By default debugging information is not activated, at present, you have to recompile the code changing the constants.h file in wam/src/ but take into account that printing messages will be a mess under ncurses. You can run the other example wamDriverTest or any embedded example inside the wam pc.

ROS WAM DEMO

You can find the instructions in order to run the demo here.

Site Toolbox:

Personal tools
This page was last modified on 16 March 2012, at 17:21. - This page has been accessed 2,383 times. - Disclaimers - About WikIRI