Skip to content

Sam-Mag1/jackal-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Jackal Robot

First connection

To communicate with the Jackal robot, we first need to connect through a SSH connection.

We can do it through Ethernet cable, or through a Wi-Fi connection. The preferred way is the Wi-Fi, but we need to set it up.

Enable the Wi-Fi through an ethernet connection

First of all, plug a Ethernet wire on the robot (you may need tu unplug a sensor) and on your computer.

Configure the wired connection with an IPv4 address (192.168.131.51 for example) and a netmask (255.255.255.0)

You can now connect on the robot through SSH :

ssh administrator@192.168.131.1

The password is clearpath.

To see which Wi-Fi connection are available, we can use:

sudo iw dev wlp2s0 scan | grep SSID

Once you know which SSID you want, you can go modify the following file:

sudo nano /etc/netplan/60-wireless.yaml

And enter these information:

network:
  wifis:
    # Replace WIRELESS_INTERFACE with the name of the wireless network device (Here wlp2s0)
    # Fill in the SSID and PASSWORD fields as appropriate.
    # For more options, see https://netplan.io/reference/
    WIRELESS_INTERFACE:                       # Replace with your Wi-Fi interface name (wlp2s0 for the Jackal)
      optional: true
      access-points:
        SSID_GOES_HERE:                       # Replace with your Wi-Fi SSID
          password: PASSWORD_GOES_HERE        # Replace with your Wi-Fi password
      dhcp4: true
      dhcp4-overrides:
        send-hostname: true

And run:

sudo netplan apply

The Wi-Fi is now connected, and you can check the connection using ping google.com.

Get the IP address of the robot on the Wi-Fi with ifconfig or ip a. You can now unplug the Ethernet wire and connect to the robot through Wi-Fi using SSH.

Nota: If you want to use a PEAP connection this method don't work. In this case follow the instructions below :

Use a Wi-Fi with a PEAP connection

To connect to a Wi-Fi with a PEAP connection, we need to use the wpa_supplicant tool and make netplan use it.

First, modify the /etc/netplan/60-wireless.yaml file :

network:
  version: 2
  renderer: networkd
  ethernets:
    dummy-wifi-uplink:
      match:
        name: wlp2s0
      set-name: wlp2s0
      dhcp4: true
      optional: true

Then, create a new file /etc/wpa_supplicant/wpa_supplicant-wlp2s0.conf with the following content:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
    ssid="SSID for PEAP"        # Replace with your Wi-Fi SSID
    key_mgmt=WPA-EAP
    eap=PEAP
    identity="YOUR_USERNAME"    # Replace with your username
    password="YOUR_PASSWORD"    # Replace with your password
    phase1="peaplabel=0"
    phase2="auth=MSCHAPV2"
    priority=1
}

Now you can run the following command to connect to the Wi-Fi:

sudo netplan apply
sudo systemctl restart wpa_supplicant@wlp2s0

After that, the robot should be connected to the Wi-Fi network, and stay connected even after a reboot.

Connect to the robot using SSH with Wi-Fi

Once you connected to the robot through Wi-Fi, you can use SSH to connect to it. The IP address of the robot can be reach using cpr-j100-0796.local (replace 0796 with the last 4 digits of the serial number of your robot).

To connect with SSH, you can use the following command:

ssh administrator@cpr-j100-0796.local

The password is clearpath.

Nota: If you have trouble finding the hostname of the robot (Serial number lost, hostname modified, Network that block access to .local connection, etc.), you can connect to the robot using ethernet and run hostname to get the hostname. You can also use ifconfig or ip a to get the IP address of the robot.

Docker

There is no need to work all the time on the robot. We can use a docker image to work on our computer and then transfer the files to the robot to test them.

Additionally, we can use the docker image to print some visualization of the robot, like the laser scan, wich is not possible to do on the robot directly (without connecting a screen).

Install Docker

To build the image, we need to have Docker installed on our computer. You can follow the instructions on the Docker website to install it.

Create the Dockerfile

First, we need to create a Dockerfile. This file will contain all the instructions to build the image.

mkdir docker
cd docker
touch Dockerfile

Then, we need to open the Dockerfile and add the following lines:

# Utiliser Ubuntu 20.04 comme base
FROM ubuntu:20.04

# Éviter les prompts interactifs
ENV DEBIAN_FRONTEND=noninteractive

# Mettre à jour et installer les dépendances
RUN apt-get update && apt-get install -y \
    curl \
    gnupg2 \
    lsb-release \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Ajouter la clé GPG et le repo ROS
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - \
    && sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

# Installer ROS Noetic
RUN apt-get update && apt-get install -y \
    ros-noetic-desktop-full \
    && rm -rf /var/lib/apt/lists/*

# Initialiser rosdep
RUN apt-get update && apt-get install -y python3-rosdep && \
    rosdep init && rosdep update

# Configurer l’environnement ROS
SHELL ["/bin/bash", "-c"]
RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc

# Définir le point d’entrée
CMD ["bash"]

These informations can be slightly modified depending on the tools you want to install.

If you had already build the image and need more tools, you can install them manually in the container.

Build and run the image

To launch a container with ros2 noetic :

--> Build the image:

docker build -t ros2_noetic .

--> Optionnal: Allow the container to access the X server (for GUI applications):

xhost +local:root

--> Run the container:

docker run  -it  --rm  --device /dev/dri  --name ros_noetic_jackal  -e DISPLAY=$DISPLAY  -v /tmp/.X11-unix:/tmp/.X11-unix  ros2_noetic:latest

--> Start the container:

docker start -ai ros_noetic_jackal

--> To open a new terminal in the container:

docker exec -it ros_noetic_jackal bash

Simulator of the Jackal robot

For more information about the Jackal robot simulator, you can refer to the official documentation.

Instalation and launch of the Jackal simulator

To simulate the Jackal robot, we can use the Gazebo simulator.

First of all, we need to install the Jackal packages with the following command:

sudo apt-get install ros-noetic-jackal-simulator ros-noetic-jackal-desktop ros-noetic-jackal-navigation

Then, we can launch the simulator with the following command (change the path to the world file if needed):

roslaunch jackal_gazebo jackal_world.launch config:=front_laser world_name:=/root/jackal-project/jackal_ws/src/simu_gazebo/worlds/empty_room.world

Visualize the robot in RViz

To visualize the robot in RViz, we can use the following command:

roslaunch jackal_viz view_robot.launch

Get the log files

To get the log files from the robot sensors, we can use the rosbag tool. It register all the topics we want in a file, that can be re-played later.

To record some topics, we can use the following command:

rosbag record -O <name_of_the_file> /topic1 /topic2 /topic3

To record all the topics, we can use:

rosbag record -O <name_of_the_file> -a

To play the bag file, we can use:

rosbag play <name_of_the_file>

Thanks to this tool, we can record all the topics we want and play them later to test our code, even if the robot is not connected (in the docker environment for example).

ROS

ROS is already installed on the robot, with all dependencies needed to run the Jackal robot.

Just by powering on the robot, there is a ros environment that is launched. We can check it by running:

rosnode list

or

rostopic list

If you want to see the topics that are published, you can use:

rostopic echo /topic_name

To see the information about a topic, you can use:

rostopic info /topic_name

Main topics existing

/cmd_vel

This topic is used to control the robot. It is a geometry_msgs/Twist message that contains the linear and angular velocities of the robot.

Just by publishing a message on this topic, we can control the robot.

/scan

This topic is used to get the laser scan data. It is a sensor_msgs/LaserScan message that contains the distance of the obstacles around the robot.

to complete

Following a path

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published