Commit c24f1115 authored by Jordan Lack's avatar Jordan Lack

Update docs

parent 353f1338
Pipeline #60857853 (#950) passed with stages
in 51 minutes and 34 seconds
......@@ -38,7 +38,7 @@ namespace RobotDynamics
* // only motivation for using a pointer instead of an instance directly.
*
* // Upon construction, a body for world and a world frame are created, but no more bodies/frames exist until we add them.
* std::shared_ptr<RobotDynamics::Model> model(new RobotDynamics::Model());
* RobotDynamics::ModelPtr model(new RobotDynamics::Model());
*
* // Create body 1
* RobotDynamics::Body body1(1.0, Math::Vector3d(0.,0.,-0.1), Math::Vector3d(0.1,0.1,0.1);
......@@ -53,25 +53,25 @@ namespace RobotDynamics
* unsigned int body2_id = model->appendBody(Math::SpatialTransform(RobotDynamics::Math::Xtrans(RobotDynamics::Math::Vector3d(0.,0.,-1.0))), JointTypeRevoluteX,body2,"body2");
*
* // Each time a body is added, a reference frame is created for the body. These frames can be accessed by,
* std::shared_ptr<RobotDynamics::ReferenceFrame> body1_frame = model->bodyFrames[body1_id];
* std::shared_ptr<RobotDynamics::ReferenceFrame> body2_frame = model->bodyFrames[body2_id];
* RobotDynamics::ReferenceFramePtr body1_frame = model->bodyFrames[body1_id];
* RobotDynamics::ReferenceFramePtr body2_frame = model->bodyFrames[body2_id];
*
* // Frames are alse created at the body's center of mass. These frames can be accessed by,
* std::shared_ptr<RobotDynamics::ReferenceFrame> body1_com_frame = model->bodyCenteredFrames[body1_id];
* std::shared_ptr<RobotDynamics::ReferenceFrame> body2_com_frame = model->bodyCenteredFrames[body2_id];
* RobotDynamics::ReferenceFramePtr body1_com_frame = model->bodyCenteredFrames[body1_id];
* RobotDynamics::ReferenceFramePtr body2_com_frame = model->bodyCenteredFrames[body2_id];
*
* // Now update kinematics(see the available functions from the kinematics module or look in Kinematics.h)
* void updateKinematics(model, Q, QDot, QDDot) // Q,QDot, and QDDot here are vectors of joint positions, velocities, and accelerations
* void updateKinematics(*model, Q, QDot, QDDot) // Q,QDot, and QDDot here are vectors of joint positions, velocities, and accelerations
* // Until kinematics have been updated, the transforms stored in each reference frame will not necessarily be correct.
* // Also, you should be sure to update the kinematics each control tick.
*
* // Now some examples of some simple things you can do utilizing the reference frames
* // Create a point at the origin of body2_frame
* FramePoint body2_origin(body2_frame.get(), 0.,0.,0.);
* FramePoint body2_origin(body2_frame, 0.,0.,0.);
*
* // Now lets express that point in body1_frame
* body2_origin.changeFrame(body1_frame.get()) // body2_origin will now be expressed in the reference frame attached to body1
* body2_origin.changeFrame(body1_frame) // body2_origin will now be expressed in the reference frame attached to body1
*
* // To express the frame point(or any geometric quantity that has a frame) in world frame, this con be done by,
* body2_origin.changeFrame(model->worldFrame); // Now it's in world frame
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment