About Electrode
Much like the name implies from the medical term, Electrode is the introspection and user interface to CogniPilot's Cranium and Cerebri.
Electrode is primarily a ROS 2 workspace that allows for controlling robotic platforms through either foxglove or RVIZ 2 backends.
Electrode uses a joystick whether (virtual or physical) to control platforms.
Foxglove-studio is the recommended backend for Electrode.
Do I have to use a ROS 2 workspace based Electrode to control platforms?
No, there is a way to use Electrode with foxglove and the CogniPilot extensions on windows and linux that only uses websockets and does not require ROS 2 to be present on the system.
Foxglove-studio backend for Electrode.
By default Electrode uses foxglove-studio as the backend, for foxglove-studio to connect to a physical platform or simulation foxglove_bridge
must be running first on the target system.
Install foxglove-studio and the foxglove CogniPilot Joystick extension
Run the build_foxglove
script after following initial development system setup and follow the prompts.
Proceed to using Electrode with foxglove-studio with the platforms specific layout:
RVIZ 2 backend for Electrode
Electrode can be optionally run with the RVIZ 2 backend, however, it requires a physical joystick device for input.
By default RVIZ 2 uses B3RB as the vehicle platform but can be changed withvehicle:=<platform-name>
Joy Input
Any compatible Joy
input can be used to control the platform.
Joy input message example for B3RB
The sensor_msgs/Joy
message on topic /cerebri/in/joy
controls the b3rb
, inspect the message to see the field mappings.
---
header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
axes:
- 0.0
- 0.0 #(1)
- 0.0
- 0.0 #(2)
buttons:
- 0 #(3)
- 0 #(4)
- 0 #(5)
- 0 #(6)
- 0 #(7)
- 0 #(8)
- 0 #(9)
- 0 #(10)
---
- Throttle in Manual Mode .
- Steering in Manual Mode .
- Manual Mode
- Auto Mode
- CMD_VEL Mode
- Calibration Mode
- Front Lights On
- Front Lights Off
- Disarm
- Arm
Foxglove CogniPilot Joystick extension
Install foxglove-studio and build the foxglove CogniPilot Joystick extension
Make sure to have first run the build_foxglove
script at some point and follow the prompts.
The foxglove CogniPilot Joystick extension allows users to control a platform without the need for a physical joystick.
Using the CogniPilot Joystick extension in foxglove.
Use is simple, click the corresponding buttons to perform their actions. An example on B3RB, click and drag the smaller circle around for throttle (up/down) and steering (left/right).
Can I still use a physical josytick with foxglove?
A physical Joystick can still be used with foxglove but it requires closing the CogniPilot Joystick
panel that is automatically opened when importing a layout file like the b3rb.json
layout and running electrode with joy:=true
Example of using electrode with a physical joystick for B3RB.
While most physical joysticks on the market can be made to work with ROS 2, this example highlights a Logitech F310.
Logitech F310 button layout.
Selecting a Mode
- A : Manual Mode
- X : CMD_VEL Mode (nav2)
- B : Auto Mode (other cmd_vel)
- Y : Calibration Mode
Arming
- START: arm
- BACK: disarm
Manual Mode
- Left stick Up/Down: Throttle
- Right stick Left/Right: Steering
Front Lights
- LB: Front lights on
- RB: Front lights off
Using Electrode without a ROS 2 workspace
To use Electrode without ROS 2 on a system use foxglove-studio.
-
Download the latest foxglove-studio for your system (Linux/Windows) and install it.
If using with linux only use debian installer.
Do not use the snap version, only follow instructions for debian linux install.
-
Download the latest foxglove-cognipilot-joy extension asset
cognipilot.cognipilot-joystick-<version>.zip
for Airy. -
Unzip compressed folder and put it in correct path for operating systems foxglove-studio.
On Linux:Move and extract extension on Linux:On Windows:mkdir -p ~/.foxglove-studio/extensions mv <path-to>/cognipilot.cognipilot-joystick-*.zip ~/.foxglove-studio/extensions cd ~/.foxglove-studio/extensions unzip cognipilot.cognipilot-joystick-*.zip
- Go to
Users/<User>/
and see if there is a .foxglove-studio/extensions folder, enable seeing hidden folders if not already enabled. If the folder path exists proceed to stepd.
, if not continue with stepb.
-
Create a .foxglove-studio folder in
Users/<User>/
.Creating a .foxglove-studio folder
Users/<User>/
. -
Create an extensions folder in
Users/<User>/.foxglove-studio
.Creating an extensions folder in
Users/<User>/.foxglove-studio
. -
Go to location where
cognipilot.cognipilot-joystick-<version>.zip
was downloadedright click the .zip
and selectExtract All...
Select
Extract All...
oncognipilot.cognipilot-joystick-<version>.zip
. -
Provide extraction path to
Users/<User>/.foxglove-studio/extensions
and press extract.Provide extraction path to
Users/<User>/.foxglove-studio/extensions
.
- Go to
-
Download desired platform layout for foxglove by selecting the
<robot>.json
file on GitHub and pressing the download icon.Example of downloading
b3rb.json
layout for foxglove. -
Open the foxglove-studio application.
-
Connect foxglove-studio to the correct
foxglove_bridge
websocket'sip address
andport
in the formatws://<ip-address>:<port>
.Connecting foxglove-studio to the correct
foxglove_bridge
websocket'sip address
andport
.