-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* odrive_node but in efficient cpp * odrive_node yaml parameters * Launching odrive_node if not simulation * Updating gitmodules * Removing odrive_node * Adding custom odrive lib directly into drive node * revert to old launch strategy * fix float velocities values * Removing old motor control way * Adding USE_I2C compilation option for testing purpose * Hello odrive parameters * odrive yamled parameters * compute_velocity_cmd updated + get_motors_turns_from_odrive function * computing wheels_turns + motors initialization * computing tf from turns * Adapting new computing strategy to simulation * overall drive node cleaning * update black to 21.4b0 * checksum sometimes isn't sent by odrive but data still here * asterix and obelix yaml update + removing drive debug logs * Fixing localisation zero division * Removal of USE_I2C + robot launcher interface full revert * 0 division fix * naming convention
- Loading branch information
Showing
13 changed files
with
473 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "src/modules/lcd-driver"] | ||
path = src/modules/lcd-driver | ||
url = https://github.com/funtech-makers/ros2-i2c-lcd-driver.git | ||
[submodule "src/modules/odrive_ros"] | ||
path = src/modules/odrive_ros | ||
url = git@github.com:robotique-ecam/odrive_ros.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* BSD 3-Clause License | ||
Copyright (c) 2021, Framework Robotics GmbH | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <fcntl.h> | ||
#include <errno.h> | ||
#include <termios.h> | ||
#include <unistd.h> | ||
#include <iostream> | ||
#include <sys/file.h> | ||
#include <stdexcept> | ||
#include <regex> | ||
#include <fcntl.h> | ||
#include <sys/ioctl.h> | ||
#include <sys/types.h> | ||
#include <stdlib.h> | ||
#include "rclcpp/rclcpp.hpp" | ||
|
||
class ODrive | ||
{ | ||
public: | ||
ODrive(const std::string port, const rclcpp::Node *node); | ||
~ODrive(); | ||
|
||
// Commands | ||
int set_velocity(const int motor, const float velocity); | ||
int stop(); | ||
|
||
// Getters | ||
std::pair<float, float> get_position_velocity(const int motor_number); | ||
|
||
// General helper functions | ||
int checksum(const std::string cmd); | ||
|
||
private: | ||
int open_port(const std::string port); | ||
int send(const std::string cmd, const std::string *funct_name); | ||
std::string receive(const std::string *funct_name); | ||
bool check_double_output(const std::string s, const std::string *funct_name); | ||
|
||
const rclcpp::Node *node; | ||
|
||
int fd; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.