1#ifndef BITSIM_KINEMATICS_SPATIAL_ARM_H
2#define BITSIM_KINEMATICS_SPATIAL_ARM_H
4#include "bitsim/bitsim_config.h"
11#include <chrono/core/ChFrame.h>
12#include <chrono/core/ChVector3.h>
71 const chrono::ChVector3d &p_W);
111 real_t damping,
int max_iterations = 100,
real_t tolerance = 1.0e-6,
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
ChFrame spatial_fk(const SpatialArm &arm, const SpatialJoints &q)
The pose of the end-effector in the world, .
Definition kinematics.cpp:121
std::array< real_t, 3 > SpatialJoints
The angles of the three joints of a SpatialArm [rad].
Definition spatial_arm.h:41
std::vector< ChFrame<> > spatial_fk_all(const SpatialArm &arm, const SpatialJoints &q)
The pose in the world of every joint frame, followed by the end-effector: .
Definition kinematics.cpp:100
std::function< void(int, const SpatialJoints &, real_t)> IKObserver
Called by numerical_ik at every iteration with the iteration, the joint angles and the error [m],...
Definition spatial_arm.h:97
RealMat3d numerical_jacobian(const SpatialArm &arm, const SpatialJoints &q)
The Jacobian of the end-effector's position by central differences. It needs only the forward kinema...
Definition kinematics.cpp:158
Definition denavit_hartenberg.h:18
std::optional< SpatialJoints > spatial_ik_elbow_up(const SpatialArm &arm, const ChVector3d &p_W)
Definition kinematics.cpp:143
std::vector< SpatialJoints > spatial_ik(const SpatialArm &arm, const ChVector3d &p_W)
Definition kinematics.cpp:126
IKResult numerical_ik(const SpatialArm &arm, const ChVector3d &target, SpatialJoints q0, real_t damping, int max_iterations, real_t tolerance, real_t max_step, const IKObserver &observer)
Definition kinematics.cpp:175
Definition dc_motor_backend_base.h:9
Eigen::Matrix3< real_t > RealMat3d
3×3 matrix of type double.
Definition bitsim_types.h:86
double real_t
real_t
Definition bitsim_types.h:20
The result of numerical_ik.
Definition spatial_arm.h:85
real_t error
the distance from the end-effector to the target [m]
Definition spatial_arm.h:88
bool converged
whether the error is below the tolerance
Definition spatial_arm.h:89
int iterations
the iterations it took
Definition spatial_arm.h:87
SpatialJoints q
the joint angles reached [rad]
Definition spatial_arm.h:86
An arm with three revolute joints. Joint 1 turns the arm about the vertical axis at height h0; joints...
Definition spatial_arm.h:31
real_t h0
the height of the shoulder above the floor [m]
Definition spatial_arm.h:32
real_t l2
the forearm [m]
Definition spatial_arm.h:34
real_t l1
the upper arm [m]
Definition spatial_arm.h:33