Skip to content

Latest commit

 

History

History
88 lines (61 loc) · 2.92 KB

README.md

File metadata and controls

88 lines (61 loc) · 2.92 KB

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

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