This package contains the motor driver for my pibot. It is made for the CamJam EduKit 3. To control the motors the Raspberry Pi Gpio python packge is being used. ROS2 as middleware is being used to communicate with the robot.
The package can be installed as snap:
snap install ros2-pibot-motor-fabolhak
Snaps need interfaces in order to access ressources from outside. The following interfaces are mounted automatically:
$ snap connections
Interface Plug Slot Notes
network ros2-pibot-motor-fabolhak:network :network -
network-bind ros2-pibot-motor-fabolhak:network-bind :network-bind -
Both network
and network-bind
are required to communicate via the ROS2 (DDS) middleware with other software parts.
This package needs two additional connections in order to access the hardware GPIO. These must be manually connected via the following commands:
snap connect ros2-pibot-motor-fabolhak:hardware-observe :hardware-observe
snap connect ros2-pibot-motor-fabolhak:gpio-memory-control :gpio-memory-control
To start the ROS2 node run the following command:
sudo ros2-pibot-motor-fabolhak.run
You now can trigger the robot from an external computer within the same network:
ros2 service call /triggerMotor std_srvs/Trigger
Use snapcraft to build a new image. Make sure to have at least snapcraft version 4.2 and then run:
cd ros2_pibot_motor
snapcraft --enable-experimental-extensions