ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

JonasG's profile - activity

2022-06-14 23:59:36 -0500 received badge  Famous Question (source)
2022-06-14 23:59:36 -0500 received badge  Notable Question (source)
2020-05-07 20:53:21 -0500 received badge  Famous Question (source)
2019-04-07 22:51:52 -0500 marked best answer MoveIt Forward kinematics

Hi there,

does someone know how the forward kinematics is solved in MoveIt?

I know it is done with the getGlobalLinkTransform, but I don't know if this function solve it with a transformation matrix or in a otherwise.

Or is it only a measurement in the simulation model?

I need it for my Bachelor-Thesis to explain it a little bit.

Would be great if someone can help me out.

Best regards, Jonas

2019-04-07 22:51:21 -0500 marked best answer const Eigen::Affine3d; rotation()

Hey, I have solved the forward kinematics with moveit.

kinemtic_state->setJointGroupPositions(joint_model_group, joint_values);
const Eigen::Affine3d &arm_link_5_state = kinematic_state->getGlobalLinkTransform("arm_link_5");

x = arm_link_5_state.translation().x();
y = arm_link_5_state.translation().y();
z = arm_link_5_state.translation().z();

xx = arm_link_5_state.rotation().??;
xy = arm_link_5_state.rotation().??;
xz = arm_link_5_state.rotation().??;

I don't know how to assign the value of xx, xy, xz of the rotation matrix.

I tried:

   xx = arm_link_5_state.rotation().xx();
   xx = arm_link_5_state.rotation().x().x();
   xx = arm_link_5_state.rotation().nx();
   xx = arm_link_5_state.rotation(0,0);

Error: const LinearMatrixType has no member named xx

I don't find the class where it is declared.

It would be great if someone can help me out.

Best regards, Jonas

2019-04-07 22:49:12 -0500 marked best answer Do I have to build a package, when I want to run a node?

Hello,

I am working on my Bachelor-Thesis and I want to run a node from a MoveIt! tutorial. ( http://docs.ros.org/kinetic/api/movei... )

Do I have to build a package and set dependencies or is it enough to make a launch file? In which directory do I have to save the launch.file?

Thanks for your help.

Greetings Jonas

2019-04-07 22:48:55 -0500 marked best answer MoveIt moveit::core::RobotModel::RobotModel

Hey there,

I can not create a RobotModelConstPtr. I need this to create a RobotState ( http://docs.ros.org/jade/api/moveit_c... ).

A part of my Code:
// Construct a kinematic model const RobotModelConstPtr kinematic_model; //need it later for RobotState robot_model::RobotModel kinematic_model = (RDFLoader.getURDF(), RDFLoader.getSRDF());

The error is " 'RobotModelConstPtr' does not name a type".

This is a link to my hole code ( https://www.dropbox.com/s/rko84pkkiig... ).

It would be perfect if someone can help me out.

Thanks

The whole code:

 #include <ros/ros.h>
 #include <fstream>
 #include <sstream>
 #include <urdf/model.h>

// MoveIt!
 #include <moveit/robot_model/robot_model.h>
 #include <moveit/robot_state/robot_state.h>
 #include <moveit/rdf_loader/rdf_loader.h>

int main(int argc, char **argv)
{
  ros::init(argc, argv, "inv_node");

  ros::AsyncSpinner spinner(1);

  spinner.start();

  ros::NodeHandle nh;


// Convert urdf file in a string

  std::ifstream u("youbot_arm.urdf");

  std::stringstream su;

  su << u.rdbuf();


// upload the urdf to the parameter server

  nh.setParam("robot_description", su.str());


// Convert srdf file in a string

  std::ifstream s("youbot.srdf");

  std::stringstream ss;

  ss << s.rdbuf();


// upload the srdf to the parameter server

  nh.setParam("robot_description_semantic", ss.str());


// Initialize the robot model

  rdf_loader::RDFLoader RDFLoader(su.str(), ss.str()); 


// Construct a kinematic model

  const RobotModelConstPtr kinematic_model; //need it later for RobotState

  robot_model::RobotModel kinematic_model = (RDFLoader.getURDF(), RDFLoader.getSRDF());

  ROS_INFO("Model frame: %s", kinematic_model->getModelFrame().c_str());


// RobotStat that maintains the configuration

  robot_state::RobotStatePtr kinematic_state(new robot_state::RobotState(RobotModel);

  kinemati_state->setToDefaultValues();


// choose JointGroup

  const robot_state::JointModelGroup* joint_model_group = RobotModel.getJointModelGroup("arm_1");


// Forward Kinematics

  kinematic_state->setToRandomPositions(joint_model_group);

  const Eigen::Affine3d &end_effector_state = kinematic_state->getGlobalLinkTransform("arm_link_0");


/* Print end-effector pose. Remember that this is in the model frame */

  ROS_INFO_STREAM("Translation: " << end_effector_state.translation());

  ROS_INFO_STREAM("Rotation: " << end_effector_state.rotation());

  ros::shutdown();

  return 0;
}
2019-04-07 22:48:50 -0500 marked best answer CMakeList.txt

Hey, I want to include so moveit headers in my CMakeList.txt, because when I run catkin_make this error comes up

CMkeFiles/inv_node.dir/src/inv_node.cpp.o: In function 'main':
inv_node.cpp:(.text+0x33f): undefined reference to 'rdf_loader::RDFLoader::RDFLoader(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: ld returned 1 exit status
make[2]: *** [/home/youbot/catkin_wsj/devel/lib/inv_node/inv_node] Error 1
make[1]: *** [inv_node/CMakeFiles/inv_node.dir/all] Error 2
make: *** [all] Error2

Can anyone say me what I have to writte in my CMakeList.txt that it works?

That would be grade.

Thanks.

this is a part of my code:

#include <ros/ros.h>
#include <fstream>
#include <sstream>
#include <urdf/model.h>

// MoveIt!
#include <moveit/robot_model/robot_model.h>
#include <moveit/robot_state/robot_state.h>
#include <moveit/rdf_loader/rdf_loader.h>

int main(int argc, char **argv)
{
  ros::init(argc, argv, "inv_node");
  ros::AsyncSpinner spinner(1);
  spinner.start();

 ros::NodeHandle nh;

// Convert urdf file in a string
  std::ifstream u("youbot_arm.urdf");
  std::stringstream su;
  su << u.rdbuf();

// upload the urdf to the parameter server
  nh.setParam("robot_description", su.str());

  // Convert srdf file in a string
  std::ifstream s("youbot.srdf");
  std::stringstream ss;
  ss << s.rdbuf();

// upload the srdf to the parameter server
  nh.setParam("robot_description_semantic", ss.str());


// Initialize the robot model
// Objekt robot_model wird initialisiert durch Konstruktor der Klasse
  rdf_loader::RDFLoader::RDFLoader robot_model(su.str(), ss.str());

ros::shutdown();
return 0;
}

my CMakeList.txt:

cmake_minimu_required(VERSION 2.8.3)
project(inv_node)

find_package(catkin REQUIRED COMPONENTS
  moveit_core
  roscpp
  rospy
  urdf
)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES inv_node
  CATKIN_DEPENDS moveit_core roscpp rospy urdf
  DEPENDS system_lib
)

include_directories(
  ${catkin_INCLUDE_DIRS}
  opt/hydro/include/moveit/rdf_loader/rdf_loader.h
)

add_executable(inv_node src/inv_node.cpp)
target_link_libraries(inv_node ${catkin_LIBRARIES})
add_dependencies(inv_node inv_node_gencpp)
2019-04-07 22:48:45 -0500 received badge  Notable Question (source)
2019-04-07 22:48:44 -0500 received badge  Popular Question (source)
2018-12-14 01:32:20 -0500 received badge  Famous Question (source)
2018-12-12 19:04:02 -0500 received badge  Notable Question (source)
2018-10-17 10:24:02 -0500 received badge  Famous Question (source)
2018-10-05 15:28:54 -0500 received badge  Notable Question (source)
2018-08-06 13:23:36 -0500 received badge  Notable Question (source)
2018-08-06 13:23:36 -0500 received badge  Popular Question (source)
2018-07-31 10:04:21 -0500 received badge  Famous Question (source)
2018-06-28 04:14:28 -0500 edited question MoveIt Forward kinematics

MoveIt Forward kinematics Hi there, does someone know how the forward kinematics is solved in MoveIt? I know it is don

2018-06-28 04:00:13 -0500 edited question MoveIt Forward kinematics

MoveIt Forward kinematics Hi there, does someone know how the forward kinematics is solved in MoveIt? I know it is don

2018-06-28 04:00:13 -0500 received badge  Editor (source)
2018-06-28 03:53:44 -0500 asked a question MoveIt Forward kinematics

MoveIt Forward kinematics Hi there, does someone know how the forward kinematics is solved in MoveIt? I know it is don

2018-06-18 12:35:42 -0500 received badge  Popular Question (source)
2018-06-14 12:48:06 -0500 received badge  Popular Question (source)
2018-06-14 12:21:09 -0500 commented question const Eigen::Affine3d; rotation()

Now it works. Thanks for that @stevejp

2018-06-14 11:57:53 -0500 commented question const Eigen::Affine3d; rotation()

In my code I print the rotation with ROS_INFO_STREAM("Rotation: " << arm_link_5_state.rotation()); and that work

2018-06-14 11:47:18 -0500 commented question const Eigen::Affine3d; rotation()

.linear().xx()? I don't find it in the doc.

2018-06-14 09:32:12 -0500 asked a question const Eigen::Affine3d; rotation()

const Eigen::Affine3d; rotation() Hey, I have solved the forward kinematics with moveit. kinemtic_state->setJointGr

2018-06-08 01:30:57 -0500 received badge  Enthusiast
2018-06-07 05:51:15 -0500 commented answer MoveIt Kinematics Solver No kinematics solver instantiated for this group

@arthur_ Did the KinematicsModelLoader exist? I don't finde something about it. I have a similar problem. I have upload

2018-06-07 05:28:07 -0500 commented answer Load a urdf/xml file as rosparm from a c++ ros node

@gvdhoorn sure. Sorry for that

2018-06-07 05:17:49 -0500 commented answer Inverse kinematics solver

@egiljones is openrave compatible with older versions of ROS like ROS hydro?

2018-06-07 03:48:47 -0500 commented answer Load a urdf/xml file as rosparm from a c++ ros node

@vacky11 do you have any experience of using a kdl plugin with moveit, for solving inverse kinematics with the setFromIK

2018-06-06 03:45:37 -0500 received badge  Famous Question (source)
2018-06-06 03:45:27 -0500 commented answer MoveIt moveit::core::RobotModel::RobotModel

@ahendrix Do you have experience by using KDL PLugins for computing inverse kinematics?

2018-06-06 03:44:30 -0500 commented answer CMakeList.txt

@mig Do you have experience by using KDL PLugins for computing inverse kinematics?

2018-06-05 11:13:27 -0500 asked a question setFromIK / kinematic solver

setFromIK / kinematic solver Hey, I want to use the setFromIK-function of the robot_state class. There is a upcoming e

2018-06-04 14:39:30 -0500 commented answer Load a urdf/xml file as rosparm from a c++ ros node

@vacky11 thank you very much, that was the point. Now it works. I am so glad that you helped me out. ;)

2018-06-04 13:23:42 -0500 commented answer Load a urdf/xml file as rosparm from a c++ ros node

https://answers.ros.org/question/293155/cmakelisttxt/ There is a part of my code.

2018-06-04 13:09:06 -0500 commented answer Load a urdf/xml file as rosparm from a c++ ros node

With which function do you use the urdf from the parameter server?

2018-06-04 13:08:00 -0500 commented answer Load a urdf/xml file as rosparm from a c++ ros node

@vacky11 I code it like that. Then I use the rdf_loader for initalization of my robot_model object and it give me an err

2018-06-04 13:08:00 -0500 received badge  Commentator
2018-06-04 11:16:04 -0500 commented answer Load a urdf/xml file as rosparm from a c++ ros node

If I code it this way: std::ifstream u ("/home/.../youbot_arm.urdf"); It cannot open the file.

2018-06-04 10:43:28 -0500 commented answer Load a urdf/xml file as rosparm from a c++ ros node

Can you please update your full code. I code it like you, but there comes an error that 'youbot_arm' was not declared in

2018-06-04 09:45:43 -0500 commented answer CMakeList.txt

Thanks. Now it works.

2018-06-04 09:41:04 -0500 received badge  Notable Question (source)
2018-06-04 08:23:46 -0500 commented answer CMakeList.txt

Thanks for your help :)

2018-06-04 08:20:54 -0500 commented answer CMakeList.txt

Directory opt/ros/hydro/include/moveit_ros_planning contains PlanExecutionDynamicReconfigureConfig.h, PlanningSceneMonit

2018-06-04 08:20:23 -0500 received badge  Popular Question (source)