Skip to content

Commit

Permalink
Merge pull request #220 from NOSALRO/robot_examples
Browse files Browse the repository at this point in the history
Updated Supported Robots
  • Loading branch information
costashatz authored Sep 3, 2024
2 parents 011000c + 68ff90c commit 62d365a
Show file tree
Hide file tree
Showing 13 changed files with 233 additions and 18 deletions.
Binary file added docs/images/tiago.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/vx300.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
118 changes: 104 additions & 14 deletions docs/robots/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/search/search_index.json

Large diffs are not rendered by default.

Binary file modified docs/sitemap.xml.gz
Binary file not shown.
Binary file added src/docs/docs/images/tiago.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/docs/docs/images/vx300.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 38 additions & 2 deletions src/docs/docs/robots.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ We have two URDF files:
{{TALOS}}
=== "Python"
{{TALOS_PYTHON}}

- `utheque/talos/talos_fast.urdf`:
* no collision except for the feet, which are approximated by boxes
* grippers are fixed (no movement is allowed)
Expand Down Expand Up @@ -197,6 +197,43 @@ This hexapod is a simple 6-legged robot based on dynamixel actuators. It is simi
=== "Python"
{{HELLO_WORLD_ROBOT_CREATION_PYTHON}}

## Vx-300
![Vx-300 robotic arm](images/vx300.png){: style="display: block;margin-left: auto;margin-right: auto;width:70%"}

The ViperX-300 is a versatile robotic arm developed by [Interbotix](https://docs.trossenrobotics.com/interbotix_xsarms_docs/specifications/vx300.html). It is designed for a range of applications including education, research, and light industrial tasks.

- 5 degrees of freedom plus a gripper
- URDF: [[vx300.urdf](https://github.com/NOSALRO/robot_dart/blob/master/utheque/vx300/vx300.urdf)]
- Example: [[vx300.cpp](https://github.com/resibots/robot_dart/blob/master/src/examples/vx300.cpp)] [[vx300.py](https://github.com/resibots/robot_dart/blob/master/src/examples/python/vx300.py)]

!!! note "Load Vx-300"
=== "C++"
{{VX300}}
=== "Python"
{{VX300_PYTHON}}



## Tiago (PAL Robotics)
![Tiago single-arm robot](images/tiago.png){: style="display: block;margin-left: auto;margin-right: auto;width:70%"}

Tiago is a mobile manipulator robot developed by [PAL Robotics](https://pal-robotics.com/robots/tiago/), designed for tasks such as navigation, object manipulation, and human-robot interaction.

- Datasheet: [pdf](https://pal-robotics.com/wp-content/uploads/2024/04/Datasheet-TIAGo.pdfs)
- Height: 110 - 145 cm
- Weight: 70 kg
- Degrees of Freedom (DoF): 7 (Arm), 2 (Head), 2 (Mobile Base)
- Force/Torque sensor in the gripper
- URDF: [[tiago.urdf](https://github.com/NOSALRO/robot_dart/blob/master/utheque/tiago/tiago_steel.urdf)]
- Example: [[tiago.cpp](https://github.com/resibots/robot_dart/blob/master/src/examples/tiago.cpp)] [[tiago.py](https://github.com/resibots/robot_dart/blob/master/src/examples/python/tiago.py)]

!!! note "Load Tiago"
=== "C++"
{{TIAGO}}
=== "Python"
{{TIAGO_PYTHON}}


## Simple arm
![simple arm robot](images/arm.png){: style="display: block;margin-left: auto;margin-right: auto;width:70%"}

Expand Down Expand Up @@ -236,4 +273,3 @@ RobotDART gives you the ability to load custom robots that are defined in [URDF
your_robot = robot_dart.Robot("path/to/model.urdf", your_model_packages)
```


2 changes: 1 addition & 1 deletion src/docs/include/macros.py

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions src/examples/python/tiago.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import RobotDART as rd
import time
import numpy as np
dt = 0.001
simu = rd.RobotDARTSimu(dt)

# this is important for wheel collision; with FCL it does not work well
simu.set_collision_detector("bullet")

freq = int(1//dt)
# @TIAGO_PYTHON@
robot = rd.Tiago(freq)
# @TIAGO_PYTHON_END@
print("the model used is [", robot.model_filename(), "]")

configuration = rd.gui.GraphicsConfiguration()
configuration.width = 1280
configuration.height = 960
configuration.bg_color = [1.0, 1.0, 1.0, 1.0]
graphics = rd.gui.Graphics(configuration)
simu.set_graphics(graphics)
graphics.look_at([0., 3., 2.], [0., 0., 0.25])
graphics.record_video("tiago_dancing.mp4")

simu.add_checkerboard_floor()
simu.add_robot(robot)

simu.set_control_freq(freq)
wheel_dofs = ["wheel_right_joint", "wheel_left_joint"]
arm_dofs = ["arm_1_joint",
"arm_2_joint",
"arm_3_joint",
"arm_4_joint",
"arm_5_joint",
"torso_lift_joint"]

init_positions = robot.positions(arm_dofs)
start = time.time()

while (simu.scheduler().next_time() < 20. and not simu.graphics().done()):
if (simu.schedule(simu.control_freq())):
delta_pos = [np.sin(simu.scheduler().current_time() * 2) + np.pi/2,
np.sin(simu.scheduler().current_time() * 2),
np.sin(simu.scheduler().current_time() * 2),
np.sin(simu.scheduler().current_time() * 2),
np.sin(simu.scheduler().current_time() * 2),
np.sin(simu.scheduler().current_time() * 2)]
commands = (init_positions + delta_pos) - robot.positions(arm_dofs)
robot.set_commands(commands, arm_dofs)
cmd = [0, 5]
robot.set_commands(cmd, wheel_dofs)
simu.step_world()

end = time.time()
elapsed_seconds = end - start
print("benchmark time: ", elapsed_seconds, " s")
robot.reset()
28 changes: 28 additions & 0 deletions src/examples/python/vx300.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import RobotDART as rd

# @VX300_PYTHON@
robot = rd.Vx300()
# @VX300_PYTHON_END@
robot.set_actuator_types("servo")

ctrl = [0.0, 1.0, -1.5, 1.0, 0.5, 0.]

controller = rd.PDControl(ctrl)
robot.add_controller(controller)

simu = rd.RobotDARTSimu()
simu.set_collision_detector("fcl")

simu.set_graphics(rd.gui.Graphics())
simu.add_robot(robot)
simu.add_checkerboard_floor()

for n in robot.dof_names():
print(n)

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)
2 changes: 2 additions & 0 deletions src/examples/tiago.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ int main()
simu.set_collision_detector("bullet");

size_t freq = 1. / dt;
// @TIAGO@
auto robot = std::make_shared<robot_dart::robots::Tiago>(freq);
// @TIAGO_END@
std::cout << "The model used is: [" << robot->model_filename() << "]" << std::endl;

#ifdef GRAPHIC
Expand Down
2 changes: 2 additions & 0 deletions src/examples/vx300.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

int main()
{
// @VX300@
auto robot = std::make_shared<robot_dart::robots::Vx300>();
// @VX300_END@
robot->set_actuator_types("servo");

Eigen::VectorXd ctrl = robot_dart::make_vector({0.0, 1.0, -1.5, 1.0, 0.5, 0.});
Expand Down

0 comments on commit 62d365a

Please sign in to comment.