Skip to content
ISC-Project-PhoenixPublic

About

Main repo for the ROS side of Project Phoenix - an autonomous go-kart

Resources

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

Phoenix

Main repo for the ROS side of Project Phoenix

Dependencies

All dependencies for phnx are described in cmake and package files. This means that if you are missing a package somewhere, it will error for you.

To ensure you have all source nodes, be sure to vcs import pheonix.repos in your workspace /src. Make sure to then Rosdep all these source nodes to drag in all binary dependencies.

If using Webots, you must install webots separately.

Building

  1. Install ROS2 Humble, and ROS2 tools
  2. Install sudo apt install python3-vcstool & sudo apt install python3-rosdep2
    • These are tools for importing/managing the other repositories for Phoenix and the dependencies for Phoenix, respectively
  3. Install Webots
    • You can most likely skip this step, since attempting a sim launch without Webots installed will prompt an offer to install the correct version; however, if this does not work, please install it manually
  4. Create your ros workspace, a dir of <ws_name>/src
  5. In src, clone this repo with Git
  6. Still in src, run cat Phoenix/phoenix.repos | vcs import to import source dependencies
    • This takes a list of repositories from the phoenix.repos file, and pipes it into the vcs import command, which will clone those repositories into your workspace
  7. Cd to the workspace root (the one that should have scr in it), and run rosdep install --from-paths src --ignore-src -r -y to install binary dependencies
    • This may take a while, try to make sure you have a reasonable internet connection
  8. Remember to source ROS2 before building source /opt/ros/humble/setup.bash and and to your bashrc with 'echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc'
  9. Still in workspace root, run colcon build to build the workspace.
    • If using clang in your IDE, run colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON (this command takes care of depthai errors)
    • If using the compile commands, they are often created in build. Move it to the workspace root, and import it into your IDE tooling.
  10. Make sure your user is a part of the unix dialout group. This allows for it to connect to USB devices. In addition, make sure you have set the udev rules for the OAK-d camera, to allow for it to connect.

The repo should now be built, and launch-able in sim or on the kart.

Note: If you want to run Phoenix via your PC then connect via ssh using following commamnd

ssh isc@<hostname or IP address>

  • This can't be done over the main university network, make sure you are connected to the same router as the onboard PC if you intend to SSH into it
  • If you want to also have some windows/gui applications carry over, add the -X flag for x11 forwarding (linux devices only)
  • for more SSH help, try man ssh

Launching

Sim

Just sim

By default, webots will be launched: ros2 launch phoenix_gazebo common.launch.py

With Go-Kart

ros2 launch phoenix_robot common.launch.py

This will spawn the autonomy stack, connecting to sensors and the CAN bus. This boots into teleop mode, so it will not output outputs of the autonomous stack (although it will be running).

Because this is designed to be headless on the kart, it's intended for this computer to be debugged over Wi-Fi. While this could be done with an adhoc network, we've found its best to just connect everything to a router, and connect to that for extra range.

By connecting with this network, one can share ROS2 instances, allowing for remote debugging and controls.

To achieve this, use the Ubiquiti Bullet AC's that are set up for long-distance teleop with the kart. You should get decent throughput out to >200m (highly dependent on environment, such as obstacles and noise. Mileage will vary!)

Once connected, run:

ros2 launch phoenix_robot utilibot.launch.py

This will launch all nodes relating to teleop and visualization that would exist in sim, but don't run on the headless kart. Because this ROS network is shared with the kart, this allows us to debug and control it.

Finally, pressing the teleop toggle switch on the controller will allow the autonomous stack to drive the kart. Toggling it again will swap back to teleop. This can be used as a sort of soft stop. Rviz can be used to view kart state.

Teleop only

If you want to just test the kart in a minimal teleop setup, you can use:

ros2 launch phoenix_robot teleop_only_kartside.launch.py

This file should be launched on a computer connected to the kart, similar to above. This can be autobooted, or just a laptop connected to the kart that will also run the utilitbot launch.

The file above needs to have both the interface board and both cameras connected. These are just used for their IMU. If desired, you can just use the encoder alone by adding encoder_only.

About

Main repo for the ROS side of Project Phoenix - an autonomous go-kart

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages