@@ -13,7 +13,7 @@ import ConnectionManager from "@/components/ConnectionManager";
1313import { useRos } from "@/contexts/RosContext" ;
1414
1515export default function Home ( ) {
16- const { isConnected, getRos, robotNamespace, connectionStatus, ensureConnection } = useRos ( ) ;
16+ const { isConnected, getRos, robotNamespace, walkPackage , setWalkPackage , connectionStatus, ensureConnection } = useRos ( ) ;
1717
1818 const [ parameters , setParameters ] = useState ( { } ) ;
1919 const [ editingParam , setEditingParam ] = useState ( null ) ;
@@ -360,7 +360,7 @@ export default function Home() {
360360
361361 const paramClient = new ROSLIB . Service ( {
362362 ros : ros ,
363- name : `${ robotNamespace } /get_parameters` ,
363+ name : `${ robotNamespace } /${ walkPackage } / get_parameters` ,
364364 serviceType : "rcl_interfaces/srv/GetParameters" ,
365365 } ) ;
366366
@@ -386,7 +386,7 @@ export default function Home() {
386386 }
387387 ) ;
388388 } ,
389- [ isConnected , robotNamespace , getRos ]
389+ [ isConnected , robotNamespace , walkPackage , getRos ]
390390 ) ;
391391
392392 const getParameterDescriptions = useCallback (
@@ -398,7 +398,7 @@ export default function Home() {
398398
399399 const paramClient = new ROSLIB . Service ( {
400400 ros : ros ,
401- name : `${ robotNamespace } /describe_parameters` ,
401+ name : `${ robotNamespace } /${ walkPackage } / describe_parameters` ,
402402 serviceType : "rcl_interfaces/srv/DescribeParameters" ,
403403 } ) ;
404404
@@ -422,7 +422,7 @@ export default function Home() {
422422 }
423423 ) ;
424424 } ,
425- [ isConnected , robotNamespace , getRos ]
425+ [ isConnected , robotNamespace , walkPackage , getRos ]
426426 ) ;
427427
428428 // Function to fetch all parameters
@@ -435,7 +435,7 @@ export default function Home() {
435435
436436 const paramClient = new ROSLIB . Service ( {
437437 ros : ros ,
438- name : `${ robotNamespace } /list_parameters` ,
438+ name : `${ robotNamespace } /${ walkPackage } / list_parameters` ,
439439 serviceType : "rcl_interfaces/srv/ListParameters" ,
440440 } ) ;
441441
@@ -455,7 +455,7 @@ export default function Home() {
455455 setShowModal ( true ) ;
456456 }
457457 ) ;
458- } , [ isConnected , robotNamespace , getRos , getParameterValues , getParameterDescriptions ] ) ;
458+ } , [ isConnected , robotNamespace , walkPackage , getRos , getParameterValues , getParameterDescriptions ] ) ;
459459
460460 const fetchROSParameters = useCallback ( ( ) => {
461461 const ros = getRos ( ) ;
@@ -520,7 +520,7 @@ export default function Home() {
520520
521521 const paramClient = new ROSLIB . Service ( {
522522 ros : ros ,
523- name : `${ robotNamespace } /set_parameters` ,
523+ name : `${ robotNamespace } /${ walkPackage } / set_parameters` ,
524524 serviceType : "rcl_interfaces/srv/SetParameters" ,
525525 } ) ;
526526
@@ -638,7 +638,7 @@ export default function Home() {
638638 // First publish the parameter list to save
639639 const paramListTopic = new ROSLIB . Topic ( {
640640 ros : ros ,
641- name : "/ param_manager/params_to_save" ,
641+ name : `/ ${ robotNamespace } / param_manager/params_to_save` ,
642642 messageType : "std_msgs/String" ,
643643 } ) ;
644644
@@ -648,7 +648,7 @@ export default function Home() {
648648 setTimeout ( ( ) => {
649649 const paramClient = new ROSLIB . Service ( {
650650 ros : ros ,
651- name : "/ param_manager/save_parameters" ,
651+ name : `/ ${ robotNamespace } / param_manager/save_parameters` ,
652652 serviceType : "std_srvs/srv/Trigger" ,
653653 } ) ;
654654
@@ -833,12 +833,12 @@ export default function Home() {
833833 }
834834
835835 console . log ( "Sending cmd_vel" , { x, y, z } ) ;
836- addLog ( `Publishing to /cmd_vel topic` , "websocket" ) ;
836+ addLog ( `Publishing to /${ robotNamespace } / cmd_vel topic` , "websocket" ) ;
837837
838838 const ros = getRos ( ) ;
839839 const cmdVel = new ROSLIB . Topic ( {
840840 ros : ros ,
841- name : "/ cmd_vel" ,
841+ name : `/ ${ robotNamespace } / cmd_vel` ,
842842 messageType : "geometry_msgs/Twist" ,
843843 } ) ;
844844
@@ -856,7 +856,7 @@ export default function Home() {
856856 } ) ;
857857
858858 cmdVel . publish ( twist ) ;
859- addLog ( `Published twist message to /cmd_vel` , "success" , {
859+ addLog ( `Published twist message to /${ robotNamespace } / cmd_vel` , "success" , {
860860 linear : { x, y, z : 0.0 } ,
861861 angular : { x : 0.0 , y : 0.0 , z } ,
862862 } ) ;
@@ -879,12 +879,12 @@ export default function Home() {
879879 return ;
880880 }
881881
882- addLog ( `Publishing stop command to /cmd_vel` , "websocket" ) ;
882+ addLog ( `Publishing stop command to /${ robotNamespace } / cmd_vel` , "websocket" ) ;
883883
884884 const ros = getRos ( ) ;
885885 const cmdVel = new ROSLIB . Topic ( {
886886 ros : ros ,
887- name : "/ cmd_vel" ,
887+ name : `/ ${ robotNamespace } / cmd_vel` ,
888888 messageType : "geometry_msgs/Twist" ,
889889 } ) ;
890890
@@ -902,7 +902,7 @@ export default function Home() {
902902 } ) ;
903903
904904 cmdVel . publish ( twist ) ;
905- addLog ( `Published stop message to /cmd_vel` , "success" , {
905+ addLog ( `Published stop message to /${ robotNamespace } / cmd_vel` , "success" , {
906906 linear : { x : 0.0 , y : 0.0 , z : 0.0 } ,
907907 angular : { x : - 1.0 , y : 0.0 , z : 0.0 } ,
908908 } ) ;
@@ -929,12 +929,12 @@ export default function Home() {
929929 // handlePlayRobot(0, 0, 0);
930930
931931 // Publish kick command to the kick topic
932- addLog ( `Publishing kick command to /kick topic` , "websocket" ) ;
932+ addLog ( `Publishing kick command to /${ robotNamespace } / kick topic` , "websocket" ) ;
933933
934934 const ros = getRos ( ) ;
935935 const kickTopic = new ROSLIB . Topic ( {
936936 ros : ros ,
937- name : "/ kick" ,
937+ name : `/ ${ robotNamespace } / kick` ,
938938 messageType : "std_msgs/msg/Bool" ,
939939 } ) ;
940940
@@ -943,7 +943,7 @@ export default function Home() {
943943 } ) ;
944944
945945 kickTopic . publish ( kick ) ;
946- addLog ( `Published kick message to /kick` , "success" , { data : true } ) ;
946+ addLog ( `Published kick message to /${ robotNamespace } / kick` , "success" , { data : true } ) ;
947947
948948 // Wait for the kick action to complete before sending stop command
949949 // This prevents the stop command from interfering with the kick
0 commit comments