-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d13c36
commit fde4b92
Showing
14 changed files
with
386 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <robot_dart/control/pd_control.hpp> | ||
#include <robot_dart/robot_dart_simu.hpp> | ||
#include <robot_dart/robots/vx300.hpp> | ||
|
||
#ifdef GRAPHIC | ||
#include <robot_dart/gui/magnum/graphics.hpp> | ||
#endif | ||
|
||
int main() | ||
{ | ||
auto robot = std::make_shared<robot_dart::robots::Vx300>(); | ||
robot->set_actuator_types("servo"); | ||
|
||
Eigen::VectorXd ctrl = robot_dart::make_vector({0.0, 1.0, -1.5, 1.0, 0.5, 0.}); | ||
|
||
auto controller = std::make_shared<robot_dart::control::PDControl>(ctrl); | ||
robot->add_controller(controller); | ||
|
||
robot_dart::RobotDARTSimu simu; | ||
simu.set_collision_detector("fcl"); | ||
#ifdef GRAPHIC | ||
simu.set_graphics(std::make_shared<robot_dart::gui::magnum::Graphics>()); | ||
#endif | ||
simu.add_robot(robot); | ||
simu.add_checkerboard_floor(); | ||
|
||
for (auto& n : robot->dof_names()) { | ||
std::cout << n << std::endl; | ||
} | ||
|
||
simu.run(2.5); | ||
|
||
ctrl << 0.0, -0.5, 0.5, -0.5, 0., 1.; | ||
controller->set_parameters(ctrl); | ||
controller->set_pd(20., 0.); | ||
simu.run(2.5); | ||
|
||
return 0; | ||
} |
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,19 @@ | ||
#ifndef ROBOT_DART_ROBOTS_VX300_HPP | ||
#define ROBOT_DART_ROBOTS_VX300_HPP | ||
|
||
#include "robot_dart/robot.hpp" | ||
|
||
namespace robot_dart { | ||
namespace robots { | ||
class Vx300 : public Robot { | ||
public: | ||
Vx300(const std::string& urdf = "vx300/vx300.urdf", const std::vector<std::pair<std::string, std::string>>& packages = {{"interbotix_xsarm_descriptions", "vx300"}}) : Robot(urdf, packages) | ||
{ | ||
fix_to_world(); | ||
set_position_enforced(true); | ||
set_color_mode("aspect"); | ||
} | ||
}; | ||
} // namespace robots | ||
} // namespace robot_dart | ||
#endif |
Oops, something went wrong.