©️C++ API
How to use C++ to play with Nybble😼 or Bittle🐶
Use the library in your own project
git submodule add https://github.com/PetoiCamp/opencat_serial_cpp opencat_serialcmake_minimum_required(VERSION 3.0.2)
project(serial_examples)
option(CATKIN_ENABLE "Enable using the Catkin make extension to cmake (ie for ROS)" OFF)
add_subdirectory(opencat_serial)
add_executable(serial_examples path/to/cpp)
target_link_libraries(serial_examples opencat_serial)Examples
#include "opencat_serial/opencat_serial.hpp"
int main(int argc, char *argv[])
{
// connect to the serial device
OpenCat::Robot rob("/path/to/port");
// create task
OpenCat::Task task;
// set command type to calibration pose
task.command = OpenCat::Command::CALIB_POSE;
// time delayed after execution
task.delay = 2;
// send command
rob.SendTask({OpenCat::Command::CALIB_POSE, 2});
return 0;
}Free curricular
Last updated
Was this helpful?