start-jsk / rtmros_common

OpenRTM - ROS interoperability packages
http://wiki.ros.org/rtmros_common
12 stars 52 forks source link

using only RTM message for servo on/off in hrpsys_dashbord #548

Open k-okada opened 10 years ago

k-okada commented 10 years ago

As I remember correctly, servo on/off from hrpsys_dashboard uses ROS message, but sometimes we want to use these fundamental features before ROS bridge has launched, so my proposal here is to use RTM message for these command.

@hyaguchijsk

k-okada commented 10 years ago

Do we have connect button (that lauch all plugin and connect them) in this GUI? http://wiki.ros.org/rtmros_nextage/Tutorials/Monitoring%2C%20operating%20via%20GUI

k-okada commented 10 years ago

if you want to customize them for specific robots, see https://github.com/start-jsk/rtmros_common/issues/127

https://github.com/start-jsk/rtmros_gazebo/blob/master/hrpsys_gazebo_atlas/scripts/atlas_hrpsys_dashboard https://github.com/start-jsk/rtmros_gazebo/blob/master/hrpsys_gazebo_atlas/src/hrpsys_gazebo_atlas/atlas_hrpsys_dashboard.py

hyaguchijsk commented 10 years ago

I compared hironx_client.py and hrpsys_dashborad.py

In hironx_client.py,

In hrpsys_dashboard.py,

I also tested hrpsys_dashborad.py with hiro014, both commands seem to work well, after using hironx_client.py.

2014-09-26 19:50 GMT+09:00 Kei Okada notifications@github.com:

if you want to customize them for specific robots, see

127 https://github.com/start-jsk/rtmros_common/issues/127

https://github.com/start-jsk/rtmros_gazebo/blob/master/hrpsys_gazebo_atlas/scripts/atlas_hrpsys_dashboard

https://github.com/start-jsk/rtmros_gazebo/blob/master/hrpsys_gazebo_atlas/src/hrpsys_gazebo_atlas/atlas_hrpsys_dashboard.py

— Reply to this email directly or view it on GitHub https://github.com/start-jsk/rtmros_common/issues/548#issuecomment-56946756 .

k-okada commented 10 years ago

1) updae http://wiki.ros.org/rtmros_nextage/Tutorials/Monitoring%2C%20operating%20via%20GUI wiki on how to servo on/off 3) create hironx_dashboard based on https://github.com/start-jsk/rtmros_common/blob/master/hrpsys_ros_bridge/scripts/hrpsys_dashboard, and add checkEncoder button 4) dashboard for hrp2 have start/stop impedance button (ask @mmurooka ), move that code into hrpsys_dashboard.py, if it is already implemented that's ok 5) overwrite servo on / off code in hironx_dasboard using RTM code directory, so that you can use hironx_dashboard without starting ros bridge code (I'm not confident in this change, if you have support/object please let me know)

mmurooka commented 10 years ago

4) dashboard for hrp2 have start/stop impedance button (ask @mmurooka ), move that code into hrpsys_dashboard.py, if it is already implemented that's ok

Now, source code of hrp2 dashboard is in jsk unreleased repository. A part of source code is following, and impedance service of hrpsys needs names of link and sensor.

            elif len(sys.argv) == 2 and sys.argv[1] == "--startIMP":
                left_param=self.ic_svc.getImpedanceControllerParam("lhsensor")
                left_param[1].base_name='CHEST_JOINT1'
                left_param[1].target_name='LARM_JOINT6'
                self.ic_svc.setImpedanceControllerParam(left_param[1])
                right_param=self.ic_svc.getImpedanceControllerParam("rhsensor")
                right_param[1].base_name='CHEST_JOINT1'
                right_param[1].target_name='RARM_JOINT6'
                self.ic_svc.setImpedanceControllerParam(right_param[1])
mmurooka commented 10 years ago

Maybe https://github.com/fkanehiro/hrpsys-base/issues/232 is related.

snozawa commented 10 years ago

In previous comments,

In `hironx_client.py`
...
In `hrpsys_dashboard.py`, 
...

I also find servoOn() function in hrpsys_config.py: https://github.com/fkanehiro/hrpsys-base/blob/master/python/hrpsys_config.py

servoOn function in hironx_client.py and hrpsys_config.py are RTM interface python script. What is the difference between them?

k-okada commented 10 years ago

https://github.com/start-jsk/rtmros_hironx/blob/hydro-devel/hironx_ros_bridge/src/hironx_ros_bridge/hironx_client.py#L413 and https://github.com/fkanehiro/hrpsys-base/blob/master/python/hrpsys_config.py#L1455 are slightly different.

hironx added the code to reset joint groups, which I'm not confident.I believe we do not need this, but urko reported we need this one.(https://code.google.com/p/rtm-ros-robotics/issues/detail?id=277). May be we need to check this again > @hyaguchijsk https://github.com/start-jsk/rtmros_hironx/blob/hydro-devel/hironx_ros_bridge/src/hironx_ros_bridge/hironx_client.py#L453

hyaguchijsk commented 10 years ago

At first time I faced the same problem (Servo On then freeze and red LED blinking) once but I forget the situation. I can not reproduce it.

As Urko's issue, I tried

I checked in following situations. All situations start after cold start-up of HIRO. Aim of the test is to check timing of resetting joint groups.

2014-10-01 10:00 GMT+09:00 Kei Okada notifications@github.com:

https://github.com/start-jsk/rtmros_hironx/blob/hydro-devel/hironx_ros_bridge/src/hironx_ros_bridge/hironx_client.py#L413 and

https://github.com/fkanehiro/hrpsys-base/blob/master/python/hrpsys_config.py#L1455 are slightly different.

hironx added the code to reset joint groups, which I'm not confident.I believe we do not need this, but urko reported we need this one.( https://code.google.com/p/rtm-ros-robotics/issues/detail?id=277). May be we need to check this again > @hyaguchijsk https://github.com/hyaguchijsk

https://github.com/start-jsk/rtmros_hironx/blob/hydro-devel/hironx_ros_bridge/src/hironx_ros_bridge/hironx_client.py#L453

— Reply to this email directly or view it on GitHub https://github.com/start-jsk/rtmros_common/issues/548#issuecomment-57405766 .

snozawa commented 10 years ago

@k-okada, thank you and I understand the difference.

hironx added the code to reset joint groups, which I'm not confident.I believe we do not need this, but urko reported we need this one.(https://code.google.com/p/rtm-ros-robotics/issues/detail?id=277). May be we need to check this again > @hyaguchijsk

When we call setJointAngles(), seq.rtc initialize joint angles based on qInit from sh.rtc. I think we need to check this qInit is adequately applied to interpolators for each JointGroup.

@hyaguchijsk One possible situation for Urko's issue is that seq.rtc is still interpolating joint angles and outputting joint angles to sh.rtc.

For example,

  1. servoOn
  2. setJointAngles or setJointAnglesOfGroup (for 20 sec)
  3. (do not wiat intepolation)
  4. servoOff (immediately)
  5. servoOn (immediately)

In 4 of this situation, robot is servoOff state but seq.rtc still outputs joint angles to sh.rtc. In 5, servoOn function calls goActual of sh.rtc, but seq.rtc still outputs joint angles to sh.rtc and reference joint angles in sh.rtc is apart from actual joint angles (encoder values).

In https://github.com/start-jsk/rtmros_hironx/blob/hydro-devel/hironx_ros_bridge/src/hironx_ros_bridge/hironx_client.py#L413 servoOn function call removeJointGroup. But in this situation, we need to call waitInterpolation or clear() for seq.rtc

hyaguchijsk commented 10 years ago

@snozawa Thanks, I reproduced the problem. Is this the problem for only HiroNX? or for all robots?

2014-10-01 21:59 GMT+09:00 Shunichi Nozawa notifications@github.com:

@k-okada https://github.com/k-okada, thank you and I understand the difference.

hironx added the code to reset joint groups, which I'm not confident.I believe we do not need this, but urko reported we need this one.( https://code.google.com/p/rtm-ros-robotics/issues/detail?id=277). May be we need to check this again > @hyaguchijsk https://github.com/hyaguchijsk

When we call setJointAngles(), seq.rtc initialize joint angles based on qInit from sh.rtc. I think we need to check this qInit is adequately applied to interpolators for each JointGroup.

@hyaguchijsk https://github.com/hyaguchijsk One possible situation for Urko's issue is that seq.rtc is still interpolating joint angles and outputting joint angles to sh.rtc.

For example,

  1. servoOn
  2. setJointAngles or setJointAnglesOfGroup (for 20 sec)
  3. (do not wiat intepolation)
  4. servoOff (immediately)
  5. servoOn (immediately)

In 4 of this situation, robot is servoOff state but seq.rtc still outputs joint angles to sh.rtc. In 5, servoOn function calls goActual of sh.rtc, but seq.rtc still outputs joint angles to sh.rtc and reference joint angles in sh.rtc is apart from actual joint angles (encoder values).

In

https://github.com/start-jsk/rtmros_hironx/blob/hydro-devel/hironx_ros_bridge/src/hironx_ros_bridge/hironx_client.py#L413 servoOn function call removeJointGroup. But in this situation, we need to call waitInterpolation or clear() for seq.rtc

— Reply to this email directly or view it on GitHub https://github.com/start-jsk/rtmros_common/issues/548#issuecomment-57458935 .

snozawa commented 10 years ago

Is this the problem for only HiroNX? or for all robots?

For all robots. This is the problem of seq.rtc and rh.rtc.

k-okada commented 10 years ago

I see, how about using https://github.com/fkanehiro/hrpsys-base/blob/master/idl/SequencePlayerService.idl#L96 and see if it under interpolating before servo on

k-okada commented 10 years ago

Cc: @130s

snozawa commented 10 years ago

I see, how about using https://github.com/fkanehiro/hrpsys-base/blob/master/idl/SequencePlayerService.idl#L96 and see if it under interpolating before servo on

+1. It seems goot test.