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

isabellezheng's profile - activity

2020-12-29 07:37:53 -0500 received badge  Famous Question (source)
2019-03-02 08:00:36 -0500 received badge  Taxonomist
2018-03-19 02:10:10 -0500 received badge  Notable Question (source)
2018-02-05 16:31:26 -0500 received badge  Popular Question (source)
2017-07-20 22:55:43 -0500 received badge  Famous Question (source)
2017-07-20 22:55:43 -0500 received badge  Notable Question (source)
2016-10-24 08:10:48 -0500 received badge  Famous Question (source)
2016-10-24 08:10:48 -0500 received badge  Famous Question (source)
2016-10-24 08:10:48 -0500 received badge  Notable Question (source)
2016-10-16 22:28:38 -0500 received badge  Popular Question (source)
2016-08-29 07:30:48 -0500 asked a question how to change the value in the callback fonction of subscriber

using namespace std;

ros::Publisher pubgauche; ros::Publisher pubdroite; ros::Subscriber subaruco;

std_msgs::Int16 vit_g; std_msgs::Int16 vit_d;

void arucoCallBack(const geometry_msgs::TransformStamped &transformMsg){

if(transformMsg.transform.translation.z > 0.4){
    vit_g.data = 64;
    vit_d.data = 64;

}   

else if(transformMsg.transform.translation.z < 0.4 && transformMsg.transform.translation.z > 0.1){
    if(transformMsg.transform.translation.x < 0.02 && transformMsg.transform.translation.x > -0.02){
        vit_g.data = 32;
        vit_d.data = 32;
    }
    else if(transformMsg.transform.translation.x > 0.02){
        vit_g.data = 32;
        vit_d.data = 25;
    }       
    else if(transformMsg.transform.translation.x < -0.02){
        vit_g.data = 25;
        vit_d.data = 32;
    }
}

else{
    vit_g.data = 0;
    vit_d.data = 0;
}


ROS_INFO("z= %f , x = %f", transformMsg.transform.translation.z, transformMsg.transform.translation.x);
ROS_INFO("advertise the info gauche %d, droite %d", vit_g.data,vit_d.data);

ros::Rate loop_rate(10);

while(ros::ok()){
    pubgauche.publish(vit_g);
    pubdroite.publish(vit_d);
    ros::spinOnce();
    loop_rate.sleep();
}

}

int main(int argc, char** argv){ ros::init(argc, argv, "cam_moteurs_node"); ros::NodeHandle nh; pubgauche = nh.advertise<std_msgs::int16>("/moteurgauche",10); pubdroite = nh.advertise<std_msgs::int16>("/moteurdroite",10);

subaruco = nh.subscribe("/aruco_single/transform",10,&arucoCallBack);
ros::spin();

}

but because i need to add the condition that we didnt seen the aruco, so i changed my code to the second version

class Transform{ public: float x,y,z; bool arucoSeen;

void callback(const geometry_msgs::TransformStamped& t); float get_x(){ return x;
} float get_y(){ return y;
} float get_z(){ return z; }

};

using namespace std;

ros::Publisher pubgauche; ros::Publisher pubdroite;

ros::Subscriber subaruco; ros::Time lastCallback; std_msgs::Int16 vit_g; std_msgs::Int16 vit_d; std_msgs::Bool arucoROSSeen;

ros::Publisher lost_pub;

bool arucoSeen = false;

void loop(float x,float y, float z,bool arucoSeen){

if(arucoSeen){

    if(z > 0.4){
    vit_g.data = 64;
    vit_d.data = 64;

}   

else if(z < 0.4 && z > 0.1){
    if(x < 0.02 && x > -0.02){
        vit_g.data = 32;
        vit_d.data = 32;
    }
    else if(x > 0.02){
        vit_g.data = 32;
        vit_d.data = 25;
    }       
    else if(x < -0.02){
        vit_g.data = 25;
        vit_d.data = 32;
    }
}

else{
    vit_g.data = 0;
    vit_d.data = 0;
}
ROS_INFO("z= %f , x = %f", z, x);
ROS_INFO("advertise the info gauche %d, droite %d", vit_g.data,vit_d.data);

}
else if(!arucoSeen){
    ROS_INFO("aruco not seen for 5 secs, start to sweep to search it");

}

}

void Transform::callback(const geometry_msgs::TransformStamped &t){ arucoSeen = true; lastCallback = ros::Time::now();

this->x = t.transform.translation.x;
this->y = t.transform.translation.y;
this->z = t.transform.translation.z;

}

int main(int argc, char** argv){ ros::init(argc, argv, "cam_moteurs_node"); ros::NodeHandle nh; ros::Duration dt; Transform transform; lost_pub = nh.advertise<std_msgs::bool>("/arucoSeen",10); pubgauche = nh.advertise<std_msgs::int16>("/moteurgauche",10); pubdroite = nh.advertise<std_msgs::int16>("/moteurdroite",10); lastCallback = ros::Time::now(); subaruco = nh.subscribe("/aruco_single/transform",10,&Transform::callback,&transform);

while(ros::ok()){
    dt = ros::Time::now() - lastCallback;
    if(dt.toSec() > 5)
        arucoSeen = false;
    arucoROSSeen.data = arucoSeen;
    lost_pub.publish(arucoROSSeen);
    ros::spinOnce();

    float x,y,z;
    x = transform.get_x();
    y = transform.get_y();
    z = transform.get_z();


    loop(x,y,z,arucoSeen);

    pubgauche.publish(vit_g);
    pubdroite.publish ...
(more)
2016-08-23 08:49:57 -0500 asked a question aruco_ros do we have a flag false when we dont find aruco?

in fact, i am using the aruco_ros and when i roslaunch the single.launch file, i can have the topic /single/pose /single/transform etc, but the problem is when the board aruco is out the sight of camera i get nothing for /single/transform, i know it's normal but what i want is when the aruco is out of sight i can get some msg for subscribing the topic of aruco, for example a flag false and i can use it in my code to express that the aruco is out of the camera

2016-08-23 08:43:50 -0500 received badge  Popular Question (source)
2016-08-20 12:49:24 -0500 commented answer Using rosjava nodes inside non-rosjava projects.

OK, i ll try to learn it , thank you so much for your advice ^ ^

2016-08-20 12:48:39 -0500 received badge  Enthusiast
2016-08-19 16:19:55 -0500 commented answer Using rosjava nodes inside non-rosjava projects.

first start the usb_cam_node and the single.launch file in the aruco_ros and also start the serial_node in the package rosserial and so on, what i want to ask is can i do all of this with just a java program? and thank you for your reply ^ ^

2016-08-19 16:16:16 -0500 commented answer Using rosjava nodes inside non-rosjava projects.

yeah i understood the roslaunch is to start multi ros nodes in the same time. for example, if i want to use aruco_ros and usb_cam and publish the info of position of the aruco symbole , at the same time the info is subscribed by a rosserial node serving for arduino, so i should step by step

2016-08-19 06:59:14 -0500 commented answer Using rosjava nodes inside non-rosjava projects.

ok, thank you, i shoud make a API java for the robot but i dont really understand how to do it to make the java code choose the action of the robot, so i am trying to write different roslaunch file and use java to open it ... if u have some advice for me, pls tell me, thank you so much

2016-08-18 08:09:05 -0500 commented answer Using rosjava nodes inside non-rosjava projects.

Hi, can i use a java application to launch the roslaunch file in ROS or run a node with several line in java?

2016-08-10 06:20:54 -0500 commented question usb_cam exit code-11 on arm firefly rk3288

in fact i found that not a pb of current , it is because i changed a camera , the camera i use for now is logitech, can u pls tell me you use gscam with indigo or other?

2016-08-10 06:19:54 -0500 received badge  Notable Question (source)
2016-08-03 06:36:19 -0500 commented question usb_cam exit code-11 on arm firefly rk3288

yes, its because i used a usb switch which is connected to the arm and connected the keyboard the camera and etc on the usb switch -> to the arm, so it leads to the current of arm not enough, the solution is use a usb hub which is connected to other power supply, sry for bad english , hope it helps

2016-08-02 13:06:30 -0500 received badge  Popular Question (source)
2016-07-19 07:23:26 -0500 commented question usb_cam exit code-11 on arm firefly rk3288

i ve deleted the other one, thank you

2016-07-19 05:45:46 -0500 asked a question usb_cam-test.launch exit code -11

usb_cam works fine on my computer ubuntu14.04, but when it turns to the arm firefly rk3288 ubuntu 14.04 , i got the error exit code -11 when i launch the file usb_cam-test.launch, the precise info is below : firefly@firefly:/opt/ros/indigo/lib/usb_cam$ roslaunch usb_cam usb_cam-test.launch ... logging to /home/firefly/.ros/log/9ab8650a-4d99-11e6-8ca2-00904c112233/roslaunch-firefly-2668.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://firefly:59329/

SUMMARY

PARAMETERS * /image_view/autosize: True * /rosdistro: indigo * /rosversion: 1.11.20 * /usb_cam/camera_frame_id: usb_cam * /usb_cam/image_height: 480 * /usb_cam/image_width: 640 * /usb_cam/io_method: mmap * /usb_cam/pixel_format: yuyv * /usb_cam/video_device: /dev/video0

NODES / image_view (image_view/image_view) usb_cam (usb_cam/usb_cam_node)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found process[usb_cam-1]: started with pid [2686] process[image_view-2]: started with pid [2687] [usb_cam-1] process has died [pid 2686, exit code -11, cmd /opt/ros/indigo/lib/usb_cam/usb_cam_node __name:=usb_cam __log:=/home/firefly/.ros/log/9ab8650a-4d99-11e6-8ca2-00904c112233/usb_cam-1.log]. log file: /home/firefly/.ros/log/9ab8650a-4d99-11e6-8ca2-00904c112233/usb_cam-1*.log

and when i rosrun usb_cam usb_cam_node , i got segment fault : firefly@firefly:/opt/ros/indigo/lib/usb_cam$ rosrun usb_cam usb_cam_node Segmentation fault firefly@firefly:/opt/ros/indigo/lib/usb_cam$

i've tried to change the pixel_format to yuyv and reflash and reinstaller all but still got this error, thank you in advance for your information.

2016-07-19 05:45:46 -0500 asked a question usb_cam exit code-11 on arm firefly rk3288

i launch the example usb_cam-test.launch on my computer it works, but when it turns to the arm firefly rk3288 i got the error:

firefly@firefly:~$ roslaunch usb_cam usb_cam-test.launch 
... logging to /home/firefly/.ros/log/9ab8650a-4d99-11e6-8ca2-00904c112233/roslaunch-firefly-2096.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://firefly:38621/

SUMMARY
========

PARAMETERS
 * /image_view/autosize: True
 * /rosdistro: indigo
 * /rosversion: 1.11.20
 * /usb_cam/camera_frame_id: usb_cam
 * /usb_cam/image_height: 480
 * /usb_cam/image_width: 640
 * /usb_cam/io_method: mmap
 * /usb_cam/pixel_format: yuyv
 * /usb_cam/video_device: /dev/video0

NODES
  /
    image_view (image_view/image_view)
    usb_cam (usb_cam/usb_cam_node)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[usb_cam-1]: started with pid [2114]
process[image_view-2]: started with pid [2115]
[ INFO] [1468923724.026820452]: Using transport "raw"
[ INFO] [1468923724.095676535]: using default calibration URL
[ INFO] [1468923724.095989785]: camera calibration URL: file:///home/firefly/.ros/camera_info/head_camera.yaml
[ INFO] [1468923724.096226618]: Unable to open camera calibration file [/home/firefly/.ros/camera_info/head_camera.yaml]
[ WARN] [1468923724.096343285]: Camera calibration file /home/firefly/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1468923724.096473660]: Starting 'head_camera' (/dev/video0) at 640x480 via mmap (yuyv) at 30 FPS
[ WARN] [1468923724.172862035]: unknown control 'white_balance_temperature_auto'

[ WARN] [1468923724.180684535]: unknown control 'focus_auto'

[usb_cam-1] process has died [pid 2114, exit code -11, cmd /opt/ros/indigo/lib/usb_cam/usb_cam_node __name:=usb_cam __log:=/home/firefly/.ros/log/9ab8650a-4d99-11e6-8ca2-00904c112233/usb_cam-1.log].
log file: /home/firefly/.ros/log/9ab8650a-4d99-11e6-8ca2-00904c112233/usb_cam-1*.log

and i tried to run the node usb_cam_node, the result is segment fault:
firefly@firefly:/opt/ros/indigo/lib/usb_cam$ rosrun usb_cam  usb_cam_node 
[ INFO] [1468923818.447067913]: using default calibration URL
[ INFO] [1468923818.447372997]: camera calibration URL: file:///home/firefly/.ros/camera_info/head_camera.yaml
[ INFO] [1468923818.447627038]: Unable to open camera calibration file [/home/firefly/.ros/camera_info/head_camera.yaml]
[ WARN] [1468923818.447767038]: Camera calibration file /home/firefly/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1468923818.447925997]: Starting 'head_camera' (/dev/video0) at 640x480 via mmap (yuyv) at 30 FPS
[ WARN] [1468923818.537832538]: unknown control 'white_balance_temperature_auto'

[ WARN] [1468923818.552972955]: unknown control 'focus_auto'

Segmentation fault
firefly@firefly:/opt/ros/indigo/lib/usb_cam$

can somebody help with this problem? In fact i have reflash the arm and reinstaller all , but i still got the same error