Code Monkey home page Code Monkey logo

librover's Introduction

Rover Logo

librover

The following diagram shows how librover is used in the broader Rover Robotics Software stack. Most users won't need to work directly with this library and can instead use the ROS1 and ROS2 drivers which expose its functionalities. DISCLAIMER: This is a dev fork for adding ros2 functionality to the Rover Mini and Rover Mega.

librover Stack Diagram

๐Ÿ“ Table of Contents

๐Ÿง About

C++ Library for communicating with a Rover Robotics Rover Pro or Rover Zero 2.

๐Ÿ Installation

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

git clone https://github.com/RoverRobotics/librover.git
cd librover
cmake .
make
sudo make install

๐ŸŽˆ Usage

The main purpose of this library is to be a dependancy for our ROS1 and ROS2 drivers, but it can also be used if you are a hardcore C++ programmer, want to use ISAAC SDK, or if you want to create a C++ based GUI.

Below is an example on how to use this library in a C++ project

#include <librover/protocol_pro> //include robot specific library

int main(int argc, char *argv[]){
  //Initialize robot parameters
  Control::pid_gains testgains_ = {0, 0, 0};

  Control::robot_motion_mode_t robot_mode = Control::INDEPENDENT_WHEEL;
  Control::angular_scaling_params angular_scaling_params_ = {0, 1, 0, 1, 1};
  //Create a robot object with set parameters
  std::unique_ptr<BaseProtocolObject> robot_ =
      std::make_unique<Zero2ProtocolObject>("/dev/rover-zero-v2", "serial",
                                            robot_mode, testgains_,
                                            angular_scaling_params_);
  //Robot Loop  
  while (true) {
    //request robot status
    auto status = robot_->status_request();
    print_status(status);
    //set robot velocities
    robot_->set_robot_velocity({1,0});
    auto status = robot_->status_request();
    // robot_->cycle_robot_mode();

    // robot_->send_estop(true);

    // robot_->update_drivetrim(0.01);
    std::this_thread::sleep_for(std::chrono::milliseconds(50));
  }

โœ๏ธ Authors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.