captain-yoshi / BehaviorTree.MTC

Use MoveIt Task Constructor with BehaviorTree.CPP
MIT License
6 stars 2 forks source link

Port to ROS 2 #3

Open DaniGarciaLopez opened 4 months ago

DaniGarciaLopez commented 1 month ago

Hi @captain-yoshi,

I noticed that this repo has been quite inactive over the past few weeks, so I decided to port the remaining code of the main branch to ROS 2.

As I mentioned in the previous issue, the main difference I found porting the code is that task->loadRobotModel(node) (InitializeMTCTask) and moveit::task_constructor::solvers::PipelinePlanner(node, pipeline_id) (CreateMTCPipelinePlanner) need a ROS node. Previously, I was simply creating a new node in the tick() function, but I don’t think this is the recommended approach. Instead, I ended up using the method from BehaviorTree.ROS2: passing the node pointer where the BT executor is running to the BT nodes using the BT::RosNodeParams struct. This adds behaviortree_ros2 to the dependency list, but I think it's worthwhile. We might find it useful in the future.

I think we could go ahead and merge this PR so that the ROS 2 branch has something useful. I will anyway keep track of the new changes you guys add in the future and prepare new PRs to port them too.