Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add roseus program to convert raw sensor value into distance #2654

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

708yamaguchi
Copy link
Member

force_proximity_ros::ProximityArrayの形で流されている近接センサの値を、以下の3つのtopicに変換して返すプログラムを書きました。
元のforce_proximity_ros::ProximityArray型のtopic名がproximity_sensorという名前だったとすると、

  • センサの生値の初期値 (/proximity_sensor/initという名前のtopic)
  • センサの生値 - センサの生値の初期値 (/proximity_sensor/calibratedという名前のtopic)
  • 距離 (/proximity_sensor/distanceという名前のtopic)

というようなtopicをpublishします。

具体的な使い方としては、
rosparamに以下のようなyamlファイルをロードしておき、

/proximity_sensor/a: [174191.2, 140032.1, 91889.8]  # センサ固有の値
/proximity_sensor/b: [1025, 686, 841]  # 近接センサの値の初期値

ターミナル上で

roseus proximity-calibrator.l

してから、

(init)
(ros::spin-once)

すると、(ros::spin-once)するたびに上記の3つのtopicをpublishします。

@pazeshun

@708yamaguchi
Copy link
Member Author

また今は、std_msgs/Empty型の/set_init_proximitiesというtopicを送るとセンサのゼロ点補正が行われるようになっていますが、すぐにserviceで行えるようにしようと思っています。

@708yamaguchi
Copy link
Member Author

serviceから近接センサのキャリブレーションが出来るようにしました。

@pazeshun
明日baxter実機で試していただけると幸いです。

@pazeshun
Copy link
Collaborator

後はもう以下のような感じで、argに(ros::spin)を入れるだけなんだとは思いますが、
https://github.com/start-jsk/jsk_apc/blob/master/jsk_arc2017_baxter/launch/main/pick.launch#L135
何も考えなくてもrosrunでnodeとして動かせるような感じにしてもらえると動かしやすいかなあと思うので、そうしといてもらえませんでしょうか。

@708yamaguchi
Copy link
Member Author

やっつけ感がありますが、プログラムの最後に(init)(ros::spin-once)をたすことで、
rosrunでこのnodeが動くようにしました。

@708yamaguchi 708yamaguchi changed the title [WIP] Add roseus program to convert raw sensor value into distance Add roseus program to convert raw sensor value into distance Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants