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

How to use ros2 control to balance something on a 2D plane?

asked 2022-04-25 15:30:17 -0500

Andreas Ziegler gravatar image

updated 2022-04-25 15:34:38 -0500

Hi ROS community

For an experiment, I need to balance a ball on a 2D plane. I attached the 2D plane to a Franka Emika Panda robot arm. I already read the Franka Emika documentation and the ros2 control documentation.

I'm still quite confused, Some example controllers seem to use command_interfaces_ to control the joints. In this controller this doesn't seem to be the case.

In my case, I only need to modify/adjust the last two joints to control the 2 axis of the 2D plane. Can somebody guide me, how I can do this with the command_interfaces_ or do I need to use something else? I do have some basic knowledge in control theory and I did read the documentation and read through a couple of examples but I'm still quite puzzled how to use ros2 control with the Franka Emika Panda robot arm.

I appreciate any help and guidance.

Andreas

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-04-25 19:03:13 -0500

shonigmann gravatar image

I haven't worked with Franka arms in particular, but what you have linked to is a joint_trajectory_controller modified to use an effort command interface. This controller will listen for JointTrajectory messages and will write joint torques to try and track those trajectories. It will behave a bit differently depending on the information provided (e.g. if only a position setpoint is provided, it will interpolate between the position setpoints, etc) but largely speaking, this controller is meant for things like manipulators, where some planner will generate some trajectory of joints that the robot then has to follow over time.

While not impossible to use it for ball balancing, I don't think it would be my first choice. Unless you want to predict the future trajectory of the ball and provide a trajectory of joint angles that the arm can follow to achieve some desired behavior, you probably want something a bit more reactive/direct to change joint angles as the ball position estimate is updated.

I would suggest taking a look at the ForwardCommand controllers. Extending one of them will allow you to define some control law and write commands directly to the joints on whatever interface you have available. In the case of the franka robot linked, it seems like you have access to the effort interface directly, so I would suggest starting by looking at the JointGroupEffortController. This is a ForwardCommand controller - it is only writing the command you give to hardware. So you could either make a child class that extends this controller, that writes effort commands based on your control law, or you could implement your ball balancing controller as a separate node, and have that publish joint commands directly (it will be expecting a Float64MultiArray with joint efforts, in the order in which the joints are defined in your controller config file). The latter approach is probably a bit easier to get started with but will introduce some latency.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-04-25 15:30:17 -0500

Seen: 210 times

Last updated: Apr 25 '22