Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


 

Most of the scripts for these instructions are included in the Git repository: https://github.com/bsb808/kingfisher_utils

...

  1. Open terminal on Laptop (need to do this on each terminal you use)
  2. Edit the scripts/kf_connect_wifi.sh bash script (in the kingfisher_utils ROS package) with the appropriate IP addresses.  You will at least need to change the "MY_WLAN" variable to match the IP address of your machine.
    1. Also note that the script assumes your wireless device is wlan0.  You should double check the name of your wirless network interface using the command ifconfig. If your network device is under a different name, change the script to reflect your setup.
  3. Execute source scripts/kf_connect_wifi.shbashwhich looks something like this...

    Code Block
    # Source this file to set environmental variable and set route
    MY_WLAN=192.168.131.221  # Wireless address of my laptop
    KF_WLAN=192.168.131.230 # Wireless address of Kingfisher
    KF_ETH=192.168.1.11 # Wired for Kingfisher, where ROS master lives
    #sudo route add -net ${KF_ETH} netmask 255.255.255.255 gw ${KF_WLAN}
    export ROS_IP=${MY_WLAN} # My laptop
    export ROS_MASTER_URI=http://${KF_ETH}:11311
    export ROS_HOSTNAME=${MY_WLAN}
    # Do this last - if you do it twice it throws an error and stops
    sudo route add -host ${KF_ETH} gw ${KF_WLAN} dev wlan0


  4. You need to do this in each terminal you are using!
  5. Check that this was successful

    Code Block
     `env | grep ROS`
    
    Results should look like
    ```
    ROS_ROOT=/opt/ros/kinetic/share/ros
    ROS_PACKAGE_PATH=/home/leevanhoutte/kf_ws/src:/home/leevanhoutte/catkin_ws/src:/opt/ros/kinetic/share
    ROS_MASTER_URI=http://192.168.1.11:11311
    ROS_VERSION=1
    ROS_HOSTNAME=192.168.131.243
    ROSLISP_PACKAGE_DIRECTORIES=/home/leevanhoutte/kf_ws/devel/share/common-lisp:/home/leevanhoutte/catkin_ws/devel/share/common-lisp
    ROS_DISTRO=kinetic
    ROS_IP=192.168.131.243
    ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
    ```


Setup ROS Workspace


# Setup local ROS environment, otherwise it won't know about kingfisher_msgs

source ~/kf_ws/devel/setup.bash 

Test Incoming Connection

 


Now verify that you are able to yous should be able to run rosnode list and see all the nodes running on the KF.  You should see something like this...

Test Outgoing Connection

 


Test that you can publish from your laptop and that the commands make it to the robot

...

You should hear the motor spin (if you are running on shore power it might will beep and spin only a small amount since the power supply can't provide enough current).

 


Note: If you see the error "ERROR: invalid message type: kingfisher_msgs/Drive" you need to install the kingfisher-msgs ROS package.  How you do this may depend on your distribution of Ubuntu and ROS

...

Code Block
cd catkin_ws/src
git clone https://github.com/kf/kingfisher.git
cd catkin_ws
catkin_make
source devel/setup.bash 

 


Driving with Joystick

Now, in a new terminal use the following launch file to start the joystick nodes.

Code Block
roslaunch kingfisher_utils kingfisher_tankdrive.launch

 


MATLAB Snippet

Code Block
rosinit('http://192.168.131.203:11311')
kfpub = rospublisher('/cmd_drive',rostype.kingfisher_msgs_Drive);
kfmsg = rosmessage(kfpub)
kfmsg.Left = 0.1
send(kfpub,kfmsg)

 

 

 

 

 






# Source this file to set environmental variable and set routeMY_WLAN=192.168.131.221  # Wireless address of my laptopKF_WLAN=192.168.131.230 # Wireless address of KingfisherKF_ETH=192.168.1.11 # Wired for Kingfisher, where ROS master lives#sudo route add -net ${KF_ETH} netmask 255.255.255.255 gw ${KF_WLAN}export ROS_IP=${MY_WLAN} # My laptopexport ROS_MASTER_URI=http://${KF_ETH}:11311export ROS_HOSTNAME=${MY_WLAN}# Do this last - if you do it twice it throws an error and stopssudo route add -host ${KF_ETH} gw ${KF_WLAN} dev wlan0

...