-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
complete free gait rviz plugin, able to use rqt action send action to…
… move robot in rviz
- Loading branch information
1 parent
ded6542
commit b27a557
Showing
42 changed files
with
1,280 additions
and
63 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
Binary file modified
BIN
+88 Bytes
(100%)
free_gait_action_loader/src/free_gait_action_loader/action_handling.pyc
Binary file not shown.
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
Binary file not shown.
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,7 @@ | ||
<library path="lib/libfree_gait_core"> | ||
<class name="free_gait_core/AdapterDummy" | ||
type="free_gait::AdapterDummy" | ||
base_class_type="free_gait::AdapterBase"> | ||
<description>Display to preview Free Gait actions.</description> | ||
</class> | ||
</library> |
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,104 @@ | ||
/* | ||
* AdapterDummy.hpp | ||
* | ||
* Created on: Mar 23, 2017 | ||
* Author: Péter Fankhauser | ||
* Institute: ETH Zurich | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "free_gait_core/executor/AdapterBase.hpp" | ||
#include "free_gait_core/free_gait_core.hpp" | ||
#include <memory> | ||
|
||
namespace free_gait { | ||
|
||
class AdapterDummy : public AdapterBase | ||
{ | ||
public: | ||
AdapterDummy(); | ||
virtual ~AdapterDummy(); | ||
|
||
//! Copying data from real robot to free gait state. | ||
virtual bool resetExtrasWithRobot(const StepQueue& stepQueue, State& state); | ||
virtual bool updateExtrasBefore(const StepQueue& stepQueue, State& state); | ||
virtual bool updateExtrasAfter(const StepQueue& stepQueue, State& state); | ||
|
||
//! State independent functions. | ||
virtual const std::string& getWorldFrameId() const; | ||
virtual const std::string& getBaseFrameId() const; | ||
virtual const std::vector<LimbEnum>& getLimbs() const; | ||
virtual const std::vector<BranchEnum>& getBranches() const; | ||
virtual LimbEnum getLimbEnumFromLimbString(const std::string& limb) const; | ||
virtual std::string getLimbStringFromLimbEnum(const LimbEnum& limb) const; | ||
virtual std::string getBaseString() const; | ||
virtual JointNodeEnum getJointNodeEnumFromJointNodeString(const std::string& jointNode) const; | ||
virtual std::string getJointNodeStringFromJointNodeEnum(const JointNodeEnum& jointNode) const; | ||
virtual bool getLimbJointPositionsFromPositionBaseToFootInBaseFrame( | ||
const Position& positionBaseToFootInBaseFrame, const LimbEnum& limb, | ||
JointPositionsLeg& jointPositions) const; | ||
virtual Position getPositionBaseToFootInBaseFrame(const LimbEnum& limb, | ||
const JointPositionsLeg& jointPositions) const; | ||
virtual Position getPositionBaseToHipInBaseFrame(const LimbEnum& limb) const; | ||
|
||
//! Reading state of real robot. | ||
virtual bool isExecutionOk() const; | ||
virtual bool isLegGrounded(const LimbEnum& limb) const; | ||
virtual JointPositionsLeg getJointPositionsForLimb(const LimbEnum& limb) const; | ||
virtual JointPositions getAllJointPositions() const; | ||
virtual JointVelocitiesLeg getJointVelocitiesForLimb(const LimbEnum& limb) const; | ||
virtual JointVelocities getAllJointVelocities() const; | ||
virtual JointAccelerationsLeg getJointAccelerationsForLimb(const LimbEnum& limb) const; | ||
virtual JointAccelerations getAllJointAccelerations() const; | ||
virtual JointEffortsLeg getJointEffortsForLimb(const LimbEnum& limb) const; | ||
virtual JointEfforts getAllJointEfforts() const; | ||
virtual Position getPositionWorldToBaseInWorldFrame() const; | ||
virtual RotationQuaternion getOrientationBaseToWorld() const; | ||
virtual LinearVelocity getLinearVelocityBaseInWorldFrame() const; | ||
virtual LocalAngularVelocity getAngularVelocityBaseInBaseFrame() const; | ||
virtual LinearAcceleration getLinearAccelerationBaseInWorldFrame() const; | ||
virtual AngularAcceleration getAngularAccelerationBaseInBaseFrame() const; | ||
virtual Position getPositionBaseToFootInBaseFrame(const LimbEnum& limb) const; | ||
virtual Position getPositionWorldToFootInWorldFrame(const LimbEnum& limb) const; | ||
virtual Position getCenterOfMassInWorldFrame() const; | ||
|
||
/*! | ||
* Transform is frameId to world => C_IF. | ||
* @param frameId | ||
* @return | ||
*/ | ||
virtual void getAvailableFrameTransforms(std::vector<std::string>& frameTransforms) const; | ||
virtual Pose getFrameTransform(const std::string& frameId) const; | ||
virtual ControlSetup getControlSetup(const BranchEnum& branch) const; | ||
virtual ControlSetup getControlSetup(const LimbEnum& limb) const; | ||
|
||
//! Depending on state of real robot. | ||
virtual JointVelocitiesLeg getJointVelocitiesFromEndEffectorLinearVelocityInWorldFrame( | ||
const LimbEnum& limb, const LinearVelocity& endEffectorLinearVelocityInWorldFrame) const; | ||
virtual LinearVelocity getEndEffectorLinearVelocityFromJointVelocities(const LimbEnum& limb, | ||
const JointVelocitiesLeg& jointVelocities, | ||
const std::string& frameId) const; | ||
virtual JointAccelerationsLeg getJointAccelerationsFromEndEffectorLinearAccelerationInWorldFrame( | ||
const LimbEnum& limb, const LinearAcceleration& endEffectorLinearAccelerationInWorldFrame) const; | ||
|
||
//! Hook to write data to internal robot representation from state. | ||
// virtual bool setInternalDataFromState(const State& state) const; | ||
virtual bool setInternalDataFromState(const State& state, bool updateContacts = true, bool updatePosition = true, | ||
bool updateVelocity = true, bool updateAcceleration = false) const; | ||
|
||
virtual void createCopyOfState() const; | ||
virtual void resetToCopyOfState() const; | ||
|
||
const State& getState() const; | ||
|
||
private: | ||
std::unique_ptr<State> state_; | ||
std::vector<LimbEnum> limbs_; | ||
std::vector<BranchEnum> branches_; | ||
const std::string worldFrameId_; | ||
const std::string baseFrameId_; | ||
Stance footholdsInSupport_; | ||
}; | ||
|
||
} /* namespace free_gait */ |
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
40 changes: 40 additions & 0 deletions
40
free_gait_ros/include/free_gait_ros/AdapterRosInterfaceDummy.hpp
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,40 @@ | ||
/* | ||
* filename.hpp | ||
* Descriotion: | ||
* | ||
* Created on: Dec 26, 2018 | ||
* Author: Shunyao Wang | ||
* Institute: Harbin Institute of Technology, Shenzhen | ||
*/ | ||
|
||
#pragma once | ||
#include "moveit_msgs/RobotState.h" | ||
#include "free_gait_ros/free_gait_ros.hpp" | ||
|
||
namespace free_gait { | ||
|
||
class AdapterRosInterfaceDummy : public AdapterRosInterfaceBase | ||
{ | ||
public: | ||
AdapterRosInterfaceDummy(); | ||
~AdapterRosInterfaceDummy(); | ||
|
||
virtual bool subscribeToRobotState(const std::string& robotStateTopic); | ||
virtual void unsubscribeFromRobotState(); | ||
virtual const std::string getRobotStateMessageType(); | ||
virtual bool isReady() const; | ||
|
||
//! Update adapter. | ||
virtual bool initializeAdapter(AdapterBase& adapter) const; | ||
virtual bool updateAdapterWithRobotState(AdapterBase& adapter) const; | ||
|
||
void updateRobotState(const free_gait_msgs::RobotStateConstPtr& robotState); | ||
|
||
|
||
private: | ||
ros::Subscriber joint_states_sub_; | ||
JointPositions all_joint_positions_; | ||
|
||
}; | ||
|
||
} // namespace |
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<launch> | ||
<param name="/free_gait/adapter_plugin/preview" value="free_gait::AdapterDummy" /> | ||
<param name="/free_gait/adapter_ros_interface_plugin" value="free_gait::AdapterRosInterfaceDummy" /> | ||
<node pkg="free_gait_ros" type="steps_test" name="steps_test_node" | ||
output="screen"> | ||
</node> | ||
</launch> |
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,12 @@ | ||
<library path="lib/libfree_gait_ros_plugin"> | ||
<class name="free_gait_ros/AdapterRosInterfaceDummy" | ||
type="free_gait::AdapterRosInterfaceDummy" | ||
base_class_type="free_gait::AdapterRosInterfaceBase"> | ||
<description>Display to preview Free Gait actions.</description> | ||
</class> | ||
<class name="free_gait_ros/AdapterDummy" | ||
type="free_gait::AdapterDummy" | ||
base_class_type="free_gait::AdapterBase"> | ||
<description>Display to preview Free Gait actions.</description> | ||
</class> | ||
</library> |
Oops, something went wrong.