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

Moveit MoveGroupInterface C++ constructor with robot description and namespace

asked 2020-12-23 10:36:32 -0500

erdisayar gravatar image

I try to learn MoveIt C++ interface.

In MoveIt Python interface, we can define namespace and robot description name

iiwa_group_name = "iiwa_plan_group"
self.move_group_joints = moveit_commander.MoveGroupCommander(iiwa_group_name,ns=self.namespace,robot_description=self.robot_description,wait_for_servers=10)

But In C++ Interface, It seems not possible. In tutorial from MoveIt official page, the movegroup is defined as following way.
https://ros-planning.github.io/moveit...

static const std::string PLANNING_GROUP = "panda_arm";
moveit::planning_interface::MoveGroupInterface move_group(PLANNING_GROUP);

When I look at the API of MoveGroupInterface class, It seems that there is no constructor availabe to define namespace and robot description. http://docs.ros.org/en/noetic/api/mov...

How can I fix this problem?
Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-28 06:43:22 -0500

erdisayar gravatar image

I solved the problem using namespace in launch file,

For example; The robot description in parameter server is loaded as "/iiwa/robot_description". I wanted to add "iiwa" namespace using C++ script. However, I could not figure out how to do that and I used <group> tag in launch file to give a prefix "iiwa" to the C++ script. I worked.!

<launch>

<group ns="iiwa">
    <node name="tower_cpp" pkg="hanoi_tower_kuka_model" type="tower_cpp" respawn="false" output="screen">
    </node>
</group>

</launch>

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-12-23 10:36:32 -0500

Seen: 335 times

Last updated: Dec 28 '20