ros-industrial / kuka_experimental

Experimental packages for KUKA manipulators within ROS-Industrial (http://wiki.ros.org/kuka_experimental)
Apache License 2.0
276 stars 217 forks source link

rsi_simulator: allow specifying an initial state #45

Open gavanderhoorn opened 8 years ago

gavanderhoorn commented 8 years ago

This is currently hard-coded to [0, -90, 90, 0, 90, 0], but that doesn't work for all robots, so should be made configurable.

Might be nice to re-use the way the industrial_robot_simulator works (link).

gavanderhoorn commented 8 years ago

This would then mimic the way the RSI cfg would put the robot in a different initial state based on what is configured in krl/ros_rsi.src.

rtonnaer commented 7 years ago

This is something I can look into. Looks like a nice first contribution to the project.

If I understand the code in (link) correctly it checks the parameter server if initial_joint_state(s) are present and valid, and then uses them (or not).

What IF a user wants to use a different initial state? Does he/she just set them through the command line or shall I add this to the launch file? I do not get how this works in industrial_robot_simulator.

gavanderhoorn commented 7 years ago

What IF a user wants to use a different initial state? Does he/she just set them through the command line or shall I add this to the launch file?

The IRS just attempts to read the initial_joint_state parameter from the parameter server. If it finds it, it performs some checks and then uses the values it finds in there.

The RSI simulator could do something similar. In fact, you could probably copy just about everything from the IRS, and override the values in this line with those from the parameter.

gavanderhoorn commented 7 years ago

One thing to watch out for: the RSI sim is currently not a ROS node, so accessing the parameter server is not directly possible.

If you want to do this without adding a rospy dependency, an alternative approach would be to add a command line parameter (here) that takes a list of floats, and use that to override the initial value of act_joint_pos.