-
Notifications
You must be signed in to change notification settings - Fork 35
jazzy-dev #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
LitheshSari
wants to merge
11
commits into
moveit:main
Choose a base branch
from
LitheshSari:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
jazzy-dev #20
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b179442
[BUG] update for 22.04 jazzy
LitheshSari 3936178
[BUG] update for 22.04 jazzy
LitheshSari 786c817
[BUG] modify the demo launch.py
LitheshSari 2d498d0
Merge remote-tracking branch 'origin/main'
LitheshSari 0eb9b9e
[Feature] IMU support
LitheshSari 3c6abbd
[Format]: suggestions
LitheshSari d6334d2
[Feature]: about scope_exit and RAII
LitheshSari e030760
[Feature]: rewrite sensors
LitheshSari 3b62b1b
[Bugs]: fix the error
LitheshSari 1123e42
[Merge]: merge CMakeLists.txt from #24
LitheshSari b7c05e1
[Bug]: modify the initializer of MujocoRos2Control
LitheshSari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -3,6 +3,9 @@ build/ | |
install/ | ||
log/ | ||
|
||
# clion | ||
**/cmake-build-debug | ||
**/.idea | ||
# vscode | ||
**/.vscode | ||
**/.devcontainer | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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
65 changes: 65 additions & 0 deletions
65
mujoco_ros2_control/include/mujoco_ros2_control/mujoco_sensor.hpp
This file contains hidden or 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,65 @@ | ||
#ifndef MUJOCO_ROS2_CONTROL_MUJOCO_SENSOR_HPP | ||
#define MUJOCO_ROS2_CONTROL_MUJOCO_SENSOR_HPP | ||
|
||
#include <string> | ||
#include <memory> | ||
#include <Eigen/Dense> | ||
#include "hardware_interface/system_interface.hpp" | ||
#include "mujoco/mujoco.h" | ||
|
||
namespace mujoco_ros2_control | ||
{ | ||
template <typename T> | ||
struct SensorData | ||
{ | ||
std::string name; | ||
T data; | ||
int mj_sensor_index; | ||
}; | ||
|
||
struct FTSensorData | ||
{ | ||
std::string name; | ||
SensorData<Eigen::Vector3d> force; | ||
SensorData<Eigen::Vector3d> torque; | ||
}; | ||
|
||
class SensorBase{ | ||
public: | ||
std::string name_; | ||
|
||
SensorBase() = default; | ||
|
||
virtual bool init(const hardware_interface::ComponentInfo& sensor_info, const mjModel* mj_model) = 0; | ||
virtual void registerStateIface(std::vector<hardware_interface::StateInterface>& state_interface) = 0; | ||
virtual void read(const mjData* mj_data) = 0; | ||
}; | ||
|
||
class IMUSensor final : public SensorBase{ | ||
public: | ||
IMUSensor() : SensorBase(){}; | ||
bool init(const hardware_interface::ComponentInfo& sensor_info, const mjModel* mj_model) override; | ||
void registerStateIface(std::vector<hardware_interface::StateInterface>& state_interface) override; | ||
void read(const mjData* mj_data) override; | ||
private: | ||
SensorData<Eigen::Quaternion<double>> orientation; | ||
SensorData<Eigen::Vector3d> angular_velocity; | ||
SensorData<Eigen::Vector3d> linear_velocity; | ||
SensorData<Eigen::Vector3d> linear_acceleration; | ||
}; | ||
|
||
class FTSensor final : public SensorBase{ | ||
public: | ||
FTSensor() : SensorBase(){}; | ||
bool init(const hardware_interface::ComponentInfo& sensor_info, const mjModel* mj_model) override; | ||
void registerStateIface(std::vector<hardware_interface::StateInterface>& state_interface) override; | ||
void read(const mjData* mj_data) override; | ||
private: | ||
SensorData<Eigen::Vector3d> force; | ||
SensorData<Eigen::Vector3d> torque; | ||
std::vector<std::string> iface_lists; | ||
}; | ||
|
||
} // namespace mujoco_ros2_control | ||
|
||
#endif // MUJOCO_ROS2_CONTROL_MUJOCO_SENSOR_HPP |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.