-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [Destructive Update]del submodules unitree_ros
- Loading branch information
Showing
40 changed files
with
3,401 additions
and
102 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
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,31 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(robot_joint_controller) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
controller_interface | ||
hardware_interface | ||
pluginlib | ||
roscpp | ||
realtime_tools | ||
robot_msgs | ||
) | ||
|
||
catkin_package( | ||
CATKIN_DEPENDS | ||
robot_msgs | ||
controller_interface | ||
hardware_interface | ||
pluginlib | ||
roscpp | ||
INCLUDE_DIRS include | ||
LIBRARIES ${PROJECT_NAME} | ||
) | ||
|
||
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIR}) | ||
|
||
link_directories(${catkin_LIB_DIRS} lib) | ||
|
||
add_library(robot_joint_controller | ||
src/robot_joint_controller.cpp | ||
) | ||
target_link_libraries(robot_joint_controller ${catkin_LIBRARIES}) |
75 changes: 75 additions & 0 deletions
75
src/robot_joint_controller/include/robot_joint_controller.h
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,75 @@ | ||
#ifndef ROBOT_JOINT_CONTROLLER_H | ||
#define ROBOT_JOINT_CONTROLLER_H | ||
|
||
#include <ros/node_handle.h> | ||
#include <urdf/model.h> | ||
#include <control_toolbox/pid.h> | ||
#include <boost/scoped_ptr.hpp> | ||
#include <boost/thread/condition.hpp> | ||
#include <realtime_tools/realtime_publisher.h> | ||
#include <hardware_interface/joint_command_interface.h> | ||
#include <controller_interface/controller.h> | ||
#include <std_msgs/Float64.h> | ||
#include <realtime_tools/realtime_buffer.h> | ||
#include <controller_interface/controller.h> | ||
#include <hardware_interface/joint_command_interface.h> | ||
#include "robot_msgs/MotorCommand.h" | ||
#include "robot_msgs/MotorState.h" | ||
#include <geometry_msgs/WrenchStamped.h> | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <algorithm> | ||
#include <math.h> | ||
|
||
#define PosStopF (2.146E+9f) | ||
#define VelStopF (16000.0f) | ||
|
||
typedef struct | ||
{ | ||
uint8_t mode; | ||
double pos; | ||
double posStiffness; | ||
double vel; | ||
double velStiffness; | ||
double torque; | ||
} ServoCommand; | ||
|
||
namespace robot_joint_controller | ||
{ | ||
class RobotJointController: public controller_interface::Controller<hardware_interface::EffortJointInterface> | ||
{ | ||
private: | ||
hardware_interface::JointHandle joint; | ||
ros::Subscriber sub_command, sub_ft; | ||
control_toolbox::Pid pid_controller_; | ||
boost::scoped_ptr<realtime_tools::RealtimePublisher<robot_msgs::MotorState> > controller_state_publisher_ ; | ||
|
||
public: | ||
std::string name_space; | ||
std::string joint_name; | ||
urdf::JointConstSharedPtr joint_urdf; | ||
realtime_tools::RealtimeBuffer<robot_msgs::MotorCommand> command; | ||
robot_msgs::MotorCommand lastCommand; | ||
robot_msgs::MotorState lastState; | ||
ServoCommand servoCommand; | ||
|
||
RobotJointController(); | ||
~RobotJointController(); | ||
virtual bool init(hardware_interface::EffortJointInterface *robot, ros::NodeHandle &n); | ||
virtual void starting(const ros::Time& time); | ||
virtual void update(const ros::Time& time, const ros::Duration& period); | ||
virtual void stopping(); | ||
void setCommandCB(const robot_msgs::MotorCommandConstPtr& msg); | ||
void positionLimits(double &position); | ||
void velocityLimits(double &velocity); | ||
void effortLimits(double &effort); | ||
|
||
void setGains(const double &p, const double &i, const double &d, const double &i_max, const double &i_min, const bool &antiwindup = false); | ||
void getGains(double &p, double &i, double &d, double &i_max, double &i_min, bool &antiwindup); | ||
void getGains(double &p, double &i, double &d, double &i_max, double &i_min); | ||
|
||
}; | ||
} | ||
|
||
#endif |
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,27 @@ | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<name>robot_joint_controller</name> | ||
<version>0.0.0</version> | ||
<description>The robot_joint_controller package</description> | ||
<maintainer email="[email protected]">Ziqi Fan</maintainer> | ||
<license>Apache</license> | ||
<buildtool_depend>catkin</buildtool_depend> | ||
<build_depend>controller_interface</build_depend> | ||
<build_depend>hardware_interface</build_depend> | ||
<build_depend>pluginlib</build_depend> | ||
<build_depend>roscpp</build_depend> | ||
<build_export_depend>controller_interface</build_export_depend> | ||
<build_export_depend>hardware_interface</build_export_depend> | ||
<build_export_depend>pluginlib</build_export_depend> | ||
<build_export_depend>roscpp</build_export_depend> | ||
<exec_depend>controller_interface</exec_depend> | ||
<exec_depend>hardware_interface</exec_depend> | ||
<exec_depend>pluginlib</exec_depend> | ||
<exec_depend>roscpp</exec_depend> | ||
<depend>robot_msgs</depend> | ||
<!-- The export tag contains other, unspecified, tags --> | ||
<export> | ||
<!-- Other tools can request additional information be placed here --> | ||
<controller_interface plugin="${prefix}/robot_joint_controller_plugins.xml"/> | ||
</export> | ||
</package> |
8 changes: 8 additions & 0 deletions
8
src/robot_joint_controller/robot_joint_controller_plugins.xml
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,8 @@ | ||
<library path="lib/librobot_joint_controller"> | ||
<class name="robot_joint_controller/RobotJointController" | ||
type="robot_joint_controller::RobotJointController" | ||
base_class_type="controller_interface::ControllerBase"/> | ||
<description> | ||
The robot joint controller. | ||
</description> | ||
</library> |
Oops, something went wrong.